This commit is contained in:
Rico Sta. Cruz 2014-06-14 10:26:51 +08:00
parent 1e0f9716ef
commit a1950d30ab
7 changed files with 122 additions and 16 deletions

View File

@ -3,12 +3,25 @@ title: Firefox
layout: default
---
### [Firefox 30](https://developer.mozilla.org/en-US/Firefox/Releases/30) (June 2014)
* CSS: Allow `line-height` in `<input type='button'>`
* JS: `Console.count()`
* JS: ES6 array and generator comprehensions
### Firefox 29 (April 2014)
* New UI
* CSS: Unprefixed `box-shadow`
### Firefox 18 (Jan 2013)
* Faster JS compiler (IonMonkey)
* Mac retina support
* JS `window.devicePixelRatio`
* JS unprefixed `ontouchstart`
* JS: `window.devicePixelRatio`
* JS: unprefixed `ontouchstart`
* HTML: `<input type='number'>`
* HTML: `<input type='color'>`
### Firefox 17 (Nov 2012)

20
httpie.md Normal file
View File

@ -0,0 +1,20 @@
---
title: httpie
layout: default
---
$ http POST example.com/posts/3 \
Origin:example.com # HTTP headers
name="John Doe" \ # JSON data
age:=29 \ # use := for non-strings
token:=@token.txt \ # read from file (json or text)
### Forms
$ http --form POST example.com \
name="John Smith" \
cv=@document.txt
### References
* https://github.com/jakubroztocil/httpie

45
moment.md Normal file
View File

@ -0,0 +1,45 @@
---
title: Moment.js
layout: default
---
### Formatting
moment()
.format('dddd')
.format("MMM Do YY")
.format()
.fromNow() //=> "31 minutes ago"
.calendar() //=> "Last Friday at 9:32PM
### Parsing
moment("2013-03-01")
moment("2013-03-01", "YYYY-MM-DD")
moment(+new Date())
### Add
.add('days', 1)
.subtract('days', 1)
.startOf('day')
.endOf('day')
.startOf('hour')
### Internationalization
.format('L') // 06/09/2014
.format('l') // 6/9/2014
.format('LL') // June 9 2014
.format('ll') // Jun 9 2014
.format('LLL') // June 9 2014 9:32 PM
.format('lll') // Jun 9 2014 9:32 PM
.format('LLLL') // Monday, June 9 2014 9:32 PM
.format('llll') // Mon, Jun 9 2014 9:32 PM
### Reference
* http://momentjs.com/
* http://momentjs.com/docs/

25
pass.md Normal file
View File

@ -0,0 +1,25 @@
---
title: Pass
layout: default
---
### Store and retrieve
$ pass insert twitter.com/rsc
$ pass twitter.com/rsc
### Search
$ pass find twitter.com
### Management
$ pass mv twitter.com twitter.com/rsc
$ pass rm [-rf] twitter.com
$ pass cp twitter.com/rsc twitter.com/ricosc
$ pass edit twitter.com/rsc
### References
* http://passwordstore.org

View File

@ -3,7 +3,13 @@ title: Rsync
layout: default
---
rsync --progress -avz --exclude '.Trashes' --exclude '.Spotlight-V100' --exclude '.fseventsd'
rsync -avz ./src /dest
### OSX
--exclude '.Trashes'
--exclude '.Spotlight-V100'
--exclude '.fseventsd'
### Options
@ -19,6 +25,8 @@ Display:
-h, --human-readable
--progress
Skipping:
-u, --update # skip files newer on dest
-c, --checksum # skip based on checksum, not mod-time & size
@ -29,17 +37,16 @@ Backups:
--backup-dir=DIR
Include:
### Include
--exclude=PATTERN
--exclude-from=FILE
--include=PATTERN
--include-from=FILE
--exclude-from=FILE
--include-from=FILE
--files-from=FILE # read list of filenames from FILe
Archive:
### Archive
-a, --archive # archive (-rlptgoD)

10
sh.md
View File

@ -3,12 +3,7 @@ title: Shell scripting
layout: default
---
### Clever one liners
# Search and replace in all files
perl -p -i -e "s/from/to/g" **/*.css
### String substitutions by patterns
### Pattern substitution
STR=/path/to/foo.c
@ -16,7 +11,7 @@ layout: default
echo ${STR%.c}.o #=> "/path/to/foo.o"
echo ${STR##*.} #=> "c" (extension)
BASE=${SRC##*/} #=> "foo.c" (basepath)
BASE=${STR##*/} #=> "foo.c" (basepath)
DIR=${SRC%$BASE} #=> "/path/to"
### Substitutions by regex
@ -33,6 +28,7 @@ layout: default
[ -z "$CC" ] && CC=gcc # CC ||= "gcc" assignment
${CC:=gcc} # $CC || "gcc"
${CC:-gcc} # same as above
### Loops

View File

@ -8,7 +8,7 @@ layout: default
Date presets
%m/%d/%Y - 06/05/2013
%A, %B %e, %Y - Sunday, January 5, 2013
%b %e - Jan 5
%b %e %a - Jan 5 Sun
Time presets
%H:%M - 23:05