This commit is contained in:
parent
1e0f9716ef
commit
a1950d30ab
17
firefox.md
17
firefox.md
|
@ -3,12 +3,25 @@ title: Firefox
|
||||||
layout: default
|
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)
|
### Firefox 18 (Jan 2013)
|
||||||
|
|
||||||
* Faster JS compiler (IonMonkey)
|
* Faster JS compiler (IonMonkey)
|
||||||
* Mac retina support
|
* Mac retina support
|
||||||
* JS `window.devicePixelRatio`
|
* JS: `window.devicePixelRatio`
|
||||||
* JS unprefixed `ontouchstart`
|
* JS: unprefixed `ontouchstart`
|
||||||
|
* HTML: `<input type='number'>`
|
||||||
|
* HTML: `<input type='color'>`
|
||||||
|
|
||||||
### Firefox 17 (Nov 2012)
|
### Firefox 17 (Nov 2012)
|
||||||
|
|
||||||
|
|
|
@ -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
|
|
@ -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/
|
|
@ -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
|
19
rsync.md
19
rsync.md
|
@ -3,7 +3,13 @@ title: Rsync
|
||||||
layout: default
|
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
|
### Options
|
||||||
|
|
||||||
|
@ -19,6 +25,8 @@ Display:
|
||||||
-h, --human-readable
|
-h, --human-readable
|
||||||
--progress
|
--progress
|
||||||
|
|
||||||
|
Skipping:
|
||||||
|
|
||||||
-u, --update # skip files newer on dest
|
-u, --update # skip files newer on dest
|
||||||
-c, --checksum # skip based on checksum, not mod-time & size
|
-c, --checksum # skip based on checksum, not mod-time & size
|
||||||
|
|
||||||
|
@ -29,17 +37,16 @@ Backups:
|
||||||
|
|
||||||
--backup-dir=DIR
|
--backup-dir=DIR
|
||||||
|
|
||||||
Include:
|
### Include
|
||||||
|
|
||||||
--exclude=PATTERN
|
--exclude=PATTERN
|
||||||
--exclude-from=FILE
|
|
||||||
|
|
||||||
--include=PATTERN
|
--include=PATTERN
|
||||||
--include-from=FILE
|
|
||||||
|
|
||||||
|
--exclude-from=FILE
|
||||||
|
--include-from=FILE
|
||||||
--files-from=FILE # read list of filenames from FILe
|
--files-from=FILE # read list of filenames from FILe
|
||||||
|
|
||||||
Archive:
|
### Archive
|
||||||
|
|
||||||
-a, --archive # archive (-rlptgoD)
|
-a, --archive # archive (-rlptgoD)
|
||||||
|
|
||||||
|
|
10
sh.md
10
sh.md
|
@ -3,12 +3,7 @@ title: Shell scripting
|
||||||
layout: default
|
layout: default
|
||||||
---
|
---
|
||||||
|
|
||||||
### Clever one liners
|
### Pattern substitution
|
||||||
|
|
||||||
# Search and replace in all files
|
|
||||||
perl -p -i -e "s/from/to/g" **/*.css
|
|
||||||
|
|
||||||
### String substitutions by patterns
|
|
||||||
|
|
||||||
STR=/path/to/foo.c
|
STR=/path/to/foo.c
|
||||||
|
|
||||||
|
@ -16,7 +11,7 @@ layout: default
|
||||||
echo ${STR%.c}.o #=> "/path/to/foo.o"
|
echo ${STR%.c}.o #=> "/path/to/foo.o"
|
||||||
echo ${STR##*.} #=> "c" (extension)
|
echo ${STR##*.} #=> "c" (extension)
|
||||||
|
|
||||||
BASE=${SRC##*/} #=> "foo.c" (basepath)
|
BASE=${STR##*/} #=> "foo.c" (basepath)
|
||||||
DIR=${SRC%$BASE} #=> "/path/to"
|
DIR=${SRC%$BASE} #=> "/path/to"
|
||||||
|
|
||||||
### Substitutions by regex
|
### Substitutions by regex
|
||||||
|
@ -33,6 +28,7 @@ layout: default
|
||||||
|
|
||||||
[ -z "$CC" ] && CC=gcc # CC ||= "gcc" assignment
|
[ -z "$CC" ] && CC=gcc # CC ||= "gcc" assignment
|
||||||
${CC:=gcc} # $CC || "gcc"
|
${CC:=gcc} # $CC || "gcc"
|
||||||
|
${CC:-gcc} # same as above
|
||||||
|
|
||||||
### Loops
|
### Loops
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue