diff --git a/bundler.md b/bundler.md new file mode 100644 index 000000000..9990fa430 --- /dev/null +++ b/bundler.md @@ -0,0 +1,42 @@ +title: Bundler +---- + +### Gems + + gem 'hello' + gem 'hello', group: 'development' + +### Github support + + gem 'hello', github: 'rstacruz/hello' + gem 'hello', github: 'rstacruz/hello', 'branch: master' + +### Grouping + + group :development do + gem 'hello' + end + +### Deployment + + $ bundle install --without=test,development --deployment + +### Local gem development + +In your Gemfile, define a Git source and a branch: + + gem 'hello', github: 'rstacruz/hello', branch: 'master' + +And then: + + $ bundle config --global local.xxx ~/projects/xxx + +### Rake Gem tasks + + # Rakefile + require 'bundler/gem_tasks' + +Terminal: + + $ rake release + $ rake build diff --git a/canvas.md b/canvas.md index 62b007b1d..380993fe2 100644 --- a/canvas.md +++ b/canvas.md @@ -30,12 +30,30 @@ c.restore(); +### Animation + + onframe: function() { + c.clearRect(0, 0, w, h); + } + ### Transformations c.translate(0, 0) c.rotate(Math.PI*2/5) c.scale(1.0, 1.0) +To rotate along origin: + + c.translate(ox, oy) + c.rotate(theta) + c.translate(-ox, -oy) + +To scale along origin: + + c.translate(-ox*x, -oy*y) + c.scale(x, y) + c.translate(ox/x, oy/y) + See [MDN: Transformations][xform]. ### Image drawing diff --git a/command_line.md b/command_line.md new file mode 100644 index 000000000..6297e7391 --- /dev/null +++ b/command_line.md @@ -0,0 +1,84 @@ +title: Command line stuff +--- + +### List (ls) + +Usage: + + ls [options] [paths] + +Format: + + -1 One entry per line + -l Long view + -o Long view (without groups) + -C Multicolumn (sorted horizontally) + -x Multicolumn (sorted vertically) + + -F Add / after directories + -G Color + +Options: + + -R Recurse + -a Include hidden (dotfiles) + -A Include hidden (but not . and ..) + +Sorting: + + -r reverse order + -S sort by size + -t sort by time modified + -u sort by time accessed + -U sort by time created + -c sort by time status was changed + + -h Human-readable size (3k) + +### Find (find) + +Usage: + + find + +Conditions: + + -name "*.c" + + -user jonathan + -nouser + + -type f # File + -type d # Directory + -type l # Symlink + + -depth 2 # At least 3 levels deep + -regex PATTERN + + -newer file.txt + -newerm file.txt # modified newer than file.txt + -newerX file.txt # [c]hange, [m]odified, [B]create + -newerXt "1 hour ago" # [t]imestamp + +Condition flow: + + \! -name "*.c" + \( x -or y \) + +Actions: + + -exec rm {} \; + -print + -delete + +Examples: + + find . -name '*.jpg' + find . -name '*.jpg' -exec rm {} \; + + find . -newerBt "24 hours ago" + +### Search-and-replace in all files + + perl -p -i -e 's/hello/HELLO/g' **/* + diff --git a/man.md b/man.md new file mode 100644 index 000000000..8cfa85668 --- /dev/null +++ b/man.md @@ -0,0 +1,12 @@ +### Man paths + + 1 General User Commands + 2 System Calls + 3 Library Routines (*) + 4 Special Files and Sockets + 5 File formats and Conventions + 6 Games and Fun Stuff + 7 Miscellaneous Documentation + 8 System Administration + 9 Kernel and Programming Style + n Tcl/Tk diff --git a/rails-models.md b/rails-models.md index a54db255a..2191c2717 100644 --- a/rails-models.md +++ b/rails-models.md @@ -14,10 +14,6 @@ title: Rails Models has_one :through has_and_belongs_to_many - belongs_to :author, - class_name: 'User', - dependent: :destroy // delete this - ### Has many belongs_to :parent, :foreign_key => 'parent_id' class_name: 'Folder' @@ -39,6 +35,26 @@ title: Rails Models 'WHERE ps.post_id = #{id} AND ps.person_id = p.id ' + 'ORDER BY p.first_name' +### belongs to + + belongs_to :author, + :dependent => :destroy # or :delete + + :class_name => "Person" + :select => "*" + :counter_cache => true + :counter_cache => :custom_counter + :include => "Book" + :readonly => true + + :conditions => 'published = true' + + :touch => true + :touch => :authors_last_updated_at + + :primary_key => "name" + :foreign_key => "author_name" + ### Many-to-many If you have a join model: diff --git a/ronn.md b/ronn.md new file mode 100644 index 000000000..30e68a3c5 --- /dev/null +++ b/ronn.md @@ -0,0 +1,66 @@ +title: Ronn +---- + +### Generating + + $ ronn foo.ronn + + $ ronn -r foo.ronn # Creates foo.7 + + $ ronn --html --style toc,80c foo.ronn + + # manual - top center + # org - bottom left + $ ronn --manual="MY MANUAL" --organization="RONN 0.7.0" + +See [ronn.1](http://rtomayko.github.com/ronn/ronn.1.html). + +### Format + + name(1) -- short, single-sentence description + ============================================= + + ## SYNOPSIS + + `name` [...] + + ## DESCRIPTION + + A normal paragraph. This can span multiple lines and is terminated with two + or more line endings -- just like Markdown. + + Inline markup for `code`, `user input`, and **strong** are displayed + boldface; , _emphasis_, *emphasis*, are displayed in italics + (HTML) or underline (roff). + +### Linking + + Manual references like sh(1), markdown(7), roff(7), etc. are hyperlinked in + HTML output. + + Link to sections like [STANDARDS][], [SEE ALSO][], or [WITH A DIFFERENT LINK + TEXT][#SEE-ALSO]. + +### Definition lists + + * `-a`, `--argument`=[]: + One or more paragraphs describing the argument. + + * You can put whatever you *want* here, really: + Nesting and paragraph spacing are respected. + +### Frequently used sections + + ## OPTIONS + ## SYNTAX + ## ENVIRONMENT + ## RETURN VALUES + ## STANDARDS + ## SECURITY CONSIDERATIONS + ## BUGS + ## HISTORY + ## AUTHOR + ## COPYRIGHT + ## SEE ALSO + +See [ronn-format.7](http://rtomayko.github.com/ronn/ronn-format.7.html). diff --git a/rtorrent.md b/rtorrent.md new file mode 100644 index 000000000..e355b907a --- /dev/null +++ b/rtorrent.md @@ -0,0 +1,37 @@ +title: Rtorrent +--- + +### Global + + ^q Quit + +### Main view + + bksp Add torrent + + -> View download + + 1 - 7 Change view + + ^S Start download + ^D Stop download (or remove stopped) + ^K Close a torrent + + + - Change priority + +### Throttling + + a/s/d Increase the upload throttle by 1/5/50 KB + z/x/c Decrease the upload throttle by 1/5/50 KB + A/S/D Increase the download throttle by 1/5/50 KB + Z/X/C Decrease the download throttle by 1/5/50 KB + +### Download view + + 1/2 Adjust max uploads + 3/4 Adjust min peers + 5/6 Adjust max peers + +### File list view + + space Change priority diff --git a/vim.md b/vim.md index 1e17d4c74..c40ce5168 100644 --- a/vim.md +++ b/vim.md @@ -62,9 +62,6 @@ Misc zz # Center this line - `. # Go to last edit - `` # Go to last jump - Windows ------- @@ -73,10 +70,18 @@ Windows Tags ---- - ^] # Jump to definition - g] # See all definitions - ^O ^I # Back/forward + ^] # Jump to definition + g] # See all definitions + ^O ^I # Back/forward + + :tselect Classname # Find definitions of Classname + :tjump Classname # Find definitions of Classname (auto-select 1st) + :tag Classname # Jump to first definition of Classname + +Marks +----- + + `^ # Last position of cursor in insert mode + `. # Last change + `` # Last jump - :tselect Classname # Find definitions of Classname - :tjump Classname # Find definitions of Classname (auto-select 1st) - :tag Classname # Jump to first definition of Classname