This commit is contained in:
Rico Sta. Cruz 2012-12-15 20:56:59 +08:00
parent b3eea95eef
commit a8d9f4a818
8 changed files with 293 additions and 13 deletions

42
bundler.md Normal file
View File

@ -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

View File

@ -30,12 +30,30 @@
c.restore(); c.restore();
### Animation
onframe: function() {
c.clearRect(0, 0, w, h);
}
### Transformations ### Transformations
c.translate(0, 0) c.translate(0, 0)
c.rotate(Math.PI*2/5) c.rotate(Math.PI*2/5)
c.scale(1.0, 1.0) 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]. See [MDN: Transformations][xform].
### Image drawing ### Image drawing

84
command_line.md Normal file
View File

@ -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 <path> <conditions> <actions>
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' **/*

12
man.md Normal file
View File

@ -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

View File

@ -14,10 +14,6 @@ title: Rails Models
has_one :through has_one :through
has_and_belongs_to_many has_and_belongs_to_many
belongs_to :author,
class_name: 'User',
dependent: :destroy // delete this
### Has many ### Has many
belongs_to :parent, :foreign_key => 'parent_id' class_name: 'Folder' 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 ' + 'WHERE ps.post_id = #{id} AND ps.person_id = p.id ' +
'ORDER BY p.first_name' '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 ### Many-to-many
If you have a join model: If you have a join model:

66
ronn.md Normal file
View File

@ -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` [<optional>...] <flags>
## 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; <variable>, _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`=[<value>]:
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).

37
rtorrent.md Normal file
View File

@ -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

23
vim.md
View File

@ -62,9 +62,6 @@ Misc
zz # Center this line zz # Center this line
`. # Go to last edit
`` # Go to last jump
Windows Windows
------- -------
@ -73,10 +70,18 @@ Windows
Tags Tags
---- ----
^] # Jump to definition ^] # Jump to definition
g] # See all definitions g] # See all definitions
^O ^I # Back/forward ^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