with a hat tip to Sublime Text 2 Shortcuts
| ⌘; | autocomplete |
| ⌘⌥B | instant replay |
| ⌘⌥E | search across all tabs |
| Boot2Docker-cli version: v1.7.1 | |
| Git commit: 8fdc6f5 | |
| docker: 1.7.1, build 786b29d | |
| boot2docker ssh | |
| sudo curl -o /var/lib/boot2docker/profile https://gist.githubusercontent.com/garthk/d5a17007c277aa5c76de/raw/3d09c77aae38b4f2809d504784965f5a16f2de4c/profile | |
| sudo halt | |
| #maybe reboot macosx | |
| #reboot(powerof) boot2docker vm manualy in VM GUI | |
| boot2docker up |
with a hat tip to Sublime Text 2 Shortcuts
| ⌘; | autocomplete |
| ⌘⌥B | instant replay |
| ⌘⌥E | search across all tabs |
| module HashConverter | |
| class << self | |
| def to_underscore hash | |
| convert hash, :underscore | |
| end | |
| def to_camel_case hash | |
| convert hash, :camelize, :lower | |
| end | |
| def convert obj, *method | |
| case obj |
| ::uuid generates a v4 random UUID (Universally Unique IDentifier). | |
| p SecureRandom.uuid #=> "2d931510-d99f-494a-8c67-87feb05e1594" | |
| p SecureRandom.uuid #=> "bad85eb9-0713-4da7-8d36-07a8e4b00eab" | |
| p SecureRandom.uuid #=> "62936e70-1815-439b-bf89-8492855a7e6b" | |
| The version 4 UUID is purely random (except the version). It doesn’t contain meaningful information such as MAC address, time, etc. |
| $: contains an array of paths that your script will search through when using require | |
| >>$: | |
| #=> [".", "/Users/path/.ruby", "/test/path"] | |
| $0 script name | |
| $* shorter for ARGV | |
| $? returns the exit status of the last child process to finish | |
| >>`pwd` |
| https://www.google.com/accounts/RatePassword?Passwd=mypwd |
| ctags -R --exclude=.git --exclude=log * ~/.rvm/gems/<your ruby@gems> |
| class Person | |
| def name(value) | |
| @name = value | |
| self | |
| end | |
| def age(value) | |
| @age = value | |
| self | |
| end | |
| def introduce |
| my_name = "aa"; print my_name | |
| #==>aa |