From 5f39cfcbe12e44051b775645779ab40a2b006412 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Tue, 14 Mar 2023 14:12:27 +1100 Subject: [PATCH] Update arel.md (+9 more changes) --- arel.md | 12 ++++++++---- devise.md | 20 +++++++++++++------- flux.md | 12 +++++++++++- git-tricks.md | 15 ++++++++++----- gulp.md | 5 +++++ mocha-tdd.md | 1 + nodejs.md | 10 ++-------- nopt.md | 10 ++++++++-- postgresql.md | 5 +++-- python.md | 1 + 10 files changed, 62 insertions(+), 29 deletions(-) diff --git a/arel.md b/arel.md index 2d5b35d19..58e24fcd2 100644 --- a/arel.md +++ b/arel.md @@ -1,8 +1,16 @@ --- title: Arel category: Rails +layout: 2017/sheet --- +### About +{: .-intro} + +Arel is an SQL abstraction library built into Ruby on Rails. + +* + ### Tables ```rb @@ -123,7 +131,3 @@ all_time = photos_with_credits.count this_month = photos_with_credits.where(photos[:created_at].gteq(Date.today.beginning_of_month)) recent_photos = photos_with_credits.where(photos[:created_at].gteq(Date.today.beginning_of_month)).limit(5) ``` - -## Reference - -* diff --git a/devise.md b/devise.md index 59dba0191..f10b6f1d3 100644 --- a/devise.md +++ b/devise.md @@ -1,12 +1,17 @@ --- title: Devise +layout: 2017/sheet --- +### About +{: .-intro} + [Devise](https://github.com/plataformatec/devise) is a flexible authentication gem. -Installation ------------- +- + +### Installation Rails 3: Add the following to your Gemfile @@ -27,8 +32,7 @@ Generate devise for your model $ rails generate devise:views -Helpers -------- +### Helpers user_signed_in? current_user @@ -38,8 +42,7 @@ Helpers edit_user_registration_path (Edit registration) new_user_registration_path (Register new user) -Controller stuff ----------------- +### Controller stuff before_filter :authenticate_user! @@ -123,8 +126,11 @@ Routing Test helpers ------------ +### Test helpers + include Devise::TestHelpers - https://github.com/plataformatec/devise/blob/1094ba65aac1d37713f2cba71f9edad76b5ca274/lib/devise/test_helpers.rb sign_in @user sign_out @user + +See: diff --git a/flux.md b/flux.md index b3aaa1349..876ac0125 100644 --- a/flux.md +++ b/flux.md @@ -1,9 +1,19 @@ --- title: Flux architecture category: React +layout: 2017/sheet --- -## Architecture +## About + +### About +{: .-intro} + +Flux is an architecture for building client-side web applications. + +* [In-Depth Overview](https://facebook.github.io/flux/docs/in-depth-overview/) _(facebook.github.io)_ + +### Architecture * __Dispatchers__ receive *actions* that get dispatched to its listeners. diff --git a/git-tricks.md b/git-tricks.md index 6e61058ba..b358fdc3e 100644 --- a/git-tricks.md +++ b/git-tricks.md @@ -1,15 +1,16 @@ --- title: Git tricks category: Git +layout: 2017/sheet --- -## Refs +### Refs HEAD^ # 1 commit before head HEAD^^ # 2 commits before head HEAD~5 # 5 commits before head -## Branches +### Branches # create a new branch git checkout -b $branchname @@ -31,7 +32,7 @@ category: Git # go back to previous branch git checkout - -## Collaboration +### Collaboration # Rebase your changes on top of the remote master git pull --rebase upstream master @@ -43,6 +44,8 @@ category: Git Submodules ---------- +### Submodules + # Import .gitmodules git submodule init @@ -70,6 +73,8 @@ Diff Log options ----------- +### Options + --oneline e11e9f9 Commit message here @@ -131,13 +136,13 @@ Misc git bisect reset # abort -## Searching +### Searching git log --grep="fixes things" # search in commit messages git log -S"window.alert" # search in code git log -G"foo.*" # search in code (regex) -## GPG Signing +### GPG signing git config set user.signingkey # Sets GPG key to use for signing diff --git a/gulp.md b/gulp.md index ad090b30e..890be7046 100644 --- a/gulp.md +++ b/gulp.md @@ -1,8 +1,13 @@ --- title: Gulp category: JavaScript libraries +layout: 2017/sheet +tags: [Archived] +archived: The information on this sheet may possibly be outdated. --- +### Available plugins + * gulp-ruby-sass * gulp-autoprefixer * gulp-minify-css diff --git a/mocha-tdd.md b/mocha-tdd.md index 11e0a1a4f..09d6fb32b 100644 --- a/mocha-tdd.md +++ b/mocha-tdd.md @@ -1,6 +1,7 @@ --- title: Mocha.js TDD interface category: JavaScript libraries +layout: 2017/sheet --- ### TDD diff --git a/nodejs.md b/nodejs.md index 6124078be..165cbbb38 100644 --- a/nodejs.md +++ b/nodejs.md @@ -1,15 +1,9 @@ --- title: Node.js API category: Node.js -layout: 2017/sheet --- -### About -{: .-intro} - -- - -### Globals +## Globals __filename __dirname @@ -27,7 +21,7 @@ layout: 2017/sheet } }); -### Snippets +## Snippets info = require('../package.json') info.version diff --git a/nopt.md b/nopt.md index 0da5afde4..8147827b6 100644 --- a/nopt.md +++ b/nopt.md @@ -1,8 +1,16 @@ --- title: Nopt category: JavaScript libraries +layout: 2017/sheet --- +### About +{: .-intro} + +- + +### Example + ```js var args = require('nopt')({ foo: [String, null], @@ -46,5 +54,3 @@ if (args.version) { process.exit(0); } ``` - -https://www.npmjs.org/package/nopt diff --git a/postgresql.md b/postgresql.md index d67899e81..0debd9e0a 100644 --- a/postgresql.md +++ b/postgresql.md @@ -1,15 +1,16 @@ --- title: PostgreSQL category: Databases +layout: 2017/sheet --- -Replace anything within `` accordingly - ### Console $ psql #logs in to default database & default user $ sudo -u psql #logs in with a particular user +Replace anything within `` accordingly + ### Commands * Show roles: `\du` diff --git a/python.md b/python.md index 8750057b8..fd85dfbe4 100644 --- a/python.md +++ b/python.md @@ -1,6 +1,7 @@ --- title: Python category: Python +layout: 2017/sheet --- ### Tuples (immutable)