From 1288ba807c721f4d1697cf98bfa7121d6262d5c0 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Tue, 8 Jan 2013 16:37:25 +0800 Subject: [PATCH] Update. --- command_line.md | 25 +++++++++++++++++++++ curl.md | 36 ++++++++++++++++++++++++++++++ ec2.md | 40 +++++++++++++++++----------------- git.md | 14 ++++++++++++ html.md | 42 +++++++++++++++++------------------ ie.md | 8 ++++--- modernizr.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ rename.md | 22 +++++++++++++++++++ style.sass | 15 +++++++++++++ znc.md | 13 +++++++++++ 10 files changed, 228 insertions(+), 45 deletions(-) create mode 100644 curl.md create mode 100644 git.md create mode 100644 modernizr.md create mode 100644 rename.md diff --git a/command_line.md b/command_line.md index 6c1efedab..ec8102797 100644 --- a/command_line.md +++ b/command_line.md @@ -147,3 +147,28 @@ Timestamp: perl -p -i -e 's/hello/HELLO/g' **/* +## Grep + + -A num # Print `num` lines of training context + + -G # --basic-regexp (default) + -E # --extended-regexp + -P # --perl-regexp + + -f file # --file (Get patterns for file) + -F # --fixed-strings + + -h # --no-filename + -H # --with-filename + + -l # --files-with-matches (just print filenames) + -L # --files-without-match + + -r, -R # --recursive + -v # --invert-match + -i # --ignore-case + +Synonyms: + + egrep => grep -E + fgrep => grep -F diff --git a/curl.md b/curl.md new file mode 100644 index 000000000..6fdd2f1d8 --- /dev/null +++ b/curl.md @@ -0,0 +1,36 @@ +title: Curl +--- + +Options: + + -o # --output: write to file + -u user:pass # --user: Authentication + + -v # --verbose + -vv # Even more verbose + +Data options: + + -d # --data: HTTP post data + -G # --get: send -d data via get + +Headers: + + -A # --user-agent + +SSL: + + --cacert + --capath + + -E # --ecrt: Client cert file + --cert-type # der/pem/eng + +## Examples + + # Post data: + curl -d password=x http://x.com/y + + # Auth/data: + curl -u user:pass -d status="Hello" http://twitter.com/statuses/update.xml + diff --git a/ec2.md b/ec2.md index ee1b930f3..5fa08dc0f 100644 --- a/ec2.md +++ b/ec2.md @@ -3,43 +3,43 @@ title: EC2 API tools ### Install - $ sudo apt-get install ec2-api-tools ec2-ami-tools # Ubuntu - $ brew install ec2-api-tools ec2-ami-tools # OSX/Homebrew + $ sudo apt-get install ec2-api-tools ec2-ami-tools + $ brew install ec2-api-tools ec2-ami-tools ### Key pair -To use public images (AMI's), you need an SSH keypair from EC2. - - $ ec2-add-keypair my-keypair > ~/.ec2/my-keypair.pem - $ chmod 600 ec2-keypair.pem + # To use public images (AMI's), you need an SSH keypair from EC2. + ec2-add-keypair my-keypair > ~/.ec2/my-keypair.pem + chmod 600 ec2-keypair.pem ### Start an instance - # Show images (AMI's) owned by amazon, or me - $ ec2-describe-images -o self -o amazon + # Start an instance using a given AMI image: + # (Use the Ubuntu locator, or ec2-describe-images) + ec2-run-instances ami-xxxxxx -k ec2-keypair - # Start an instance using a given AMI image - $ ec2-run-instances ami-xxxxxx -k ec2-keypair + # Open up ports (in the 'default' security group): + ec2-authorize default -p 22 + ec2-authorize default -p 80 - # Open up ports (in the 'default' security group) - $ ec2-authorize default -p 22 - $ ec2-authorize default -p 80 - - # Now SSH to it - $ ssh -i ~/.ec2/my-keypair.pem root@ec2-xxx.amazonaws.com + # Connect + ssh -i ~/.ec2/my-keypair.pem root@ec2-xxx.amazonaws.com ### Management - # Show running - $ ec2-describe-instances + # Show running instances + ec2-describe-instances # Kill an instance - $ ec2-terminate-instances i-yourinstance + ec2-terminate-instances i-yourinstance ### Misc # Create a security group - $ ec2-add-group group_name -d "Description" + ec2-add-group group_name -d "Description" + + # Show images (AMI's) owned by amazon, or me + ec2-describe-images -o self -o amazon ### Ubuntu images diff --git a/git.md b/git.md new file mode 100644 index 000000000..d147bbfcc --- /dev/null +++ b/git.md @@ -0,0 +1,14 @@ +title: Git +-- + +## Submodules + + # Import .gitmodules + git submodule init + + # Clone missing submodules, and checkout commits + git submodule update --init --recursive + + # Update remote URLs in .gitmodules + # (Use when you changed remotes in submodules) + git submodule sync diff --git a/html.md b/html.md index 40c12717f..635bb9ce4 100644 --- a/html.md +++ b/html.md @@ -9,9 +9,9 @@ title: HTML ### iPhone viewport - + - + ### Default OpenGraph meta tags @@ -25,24 +25,24 @@ title: HTML ### Webfonts - + - // {typekit{id:"..."}} - // {google:{families:['Exo:400']}} + // {typekit{id:"..."}} + // {google:{families:['Exo:400']}} ### Google Analytics - + ### FB/Twitter -
+
- + ### HTML5 Shiv for IE8 - + ### H5BP HTML tag (IE8 and IE9 only) @@ -51,11 +51,11 @@ title: HTML ### Touch icons - apple-touch-icon-precomposed.png - apple-touch-icon-57x57-precomposed.png - apple-touch-icon-72x72-precomposed.png - apple-touch-icon-114x114-precomposed.png - apple-touch-icon-144x144-precomposed.png + * apple-touch-icon-precomposed.png + * apple-touch-icon-57x57-precomposed.png + * apple-touch-icon-72x72-precomposed.png + * apple-touch-icon-114x114-precomposed.png + * apple-touch-icon-144x144-precomposed.png ### Icons @@ -76,14 +76,6 @@ Only do this if you're not placing the site in the root! -### IE conditionals - - - - - - - ### Google jQuery @@ -104,3 +96,9 @@ Only do this if you're not placing the site in the root! + +### HTML Compatiblity inspector + + + +More info here: [microsoft.com](http://ie.microsoft.com/testdrive/HTML5/CompatInspector/) diff --git a/ie.md b/ie.md index 4f6b93262..d1f4bed25 100644 --- a/ie.md +++ b/ie.md @@ -17,7 +17,7 @@ CSS properties: ## Only available in IE8+ -Selectors/pseudos: ([polyfill][selectivizr]) +Selectors/pseudos: ([polyfill: selectivizr][selectivizr]) - `+` _(adjacent)_ - `:first-child` _(unless for static elements)_ @@ -46,7 +46,7 @@ JS features: ## Only available in IE9+ -Selectors/pseudos: ([polyfill][selectivizr]) +Selectors/pseudos: ([polyfill: selectivizr][selectivizr]) - `:first-of-type`, `:last-of-type` - `:last-child` @@ -73,7 +73,7 @@ CSS properties: CSS features: - - `@media` queries + - `@media` queries ([polyfill: respond.js][respond]) HTML5 features: @@ -111,6 +111,7 @@ Always install these in almost every project: - [selectivizr] for selectors - [html5shiv] for new HTML tags - [json2] for JSON parsing (IE7 below) + - [respond] for media queries You may also need these: @@ -156,3 +157,4 @@ Misc [json2]: https://github.com/douglascrockford/JSON-js [modernizr]: https://modernizr.com [ecsstender]: http://ecsstender.org/ +[respond]: https://github.com/scottjehl/Respond diff --git a/modernizr.md b/modernizr.md new file mode 100644 index 000000000..a798d5029 --- /dev/null +++ b/modernizr.md @@ -0,0 +1,58 @@ +title: Modernizr + +### Script + + + +### Detections + +JavaScript + + * js + +CSS + + * flexbox + * rgba + * hsla + * multiplebgs + * backgroundsize + * borderimage + * borderradius + * boxshadow + * textshadow + * opacity + * cssanimations + * csscolumns + * cssgradients + * cssreflections + * csstransforms + * csstransforms3d + * csstransitions + * fontface + * generatedcontent + +HTML5 + + * canvas + * canvastext + * webgl + * touch + * geolocation + * postmessage + * websqldatabase + * indexeddb + * hashchange + * history + * draganddrop + * websockets + * video + * audio + * localstorage + * sessionstorage + * webworkers + * applicationcache + * svg + * inlinesvg + * smil + * svgclippaths diff --git a/rename.md b/rename.md new file mode 100644 index 000000000..21ad12079 --- /dev/null +++ b/rename.md @@ -0,0 +1,22 @@ +title: rename +--- + +### Installation + + # http://plasmasturm.org/code/rename/ + brew install rename + +### Examples + + # Rename hello.txt to world.txt and so on + rename 's/hello/world/' *.txt + + # Search and replace + rename -s .png .jpg.png *.png + + +### Options + + -n # Simulation + -l # Symlink instead of rename + -i # Interactive diff --git a/style.sass b/style.sass index 9614db0fa..a82c0789e 100644 --- a/style.sass +++ b/style.sass @@ -22,6 +22,21 @@ html background: #505060 * 0.8 padding: 60px 20px +a + &, &:visited + background-color: mix(#db3, white, 30%) + color: #db3 * 0.6 + text-shadow: 0 1px 1px rgba(white, 0.2) + + padding: 1px 2px + box-shadow: 0 1px 1px rgba(black, 0.3) + border-radius: 2px + + text-decoration: none + + &:hover + background-color: mix(#db3, white, 50%) + @media screen and (max-width: 800px) html padding: 20px diff --git a/znc.md b/znc.md index 8d44b2e25..e31286e0d 100644 --- a/znc.md +++ b/znc.md @@ -1,6 +1,19 @@ title: ZNC bouncer --- +## Start + + /msg *status addserver irc.undernet.org [6667] + /msg *status connect + + /msg *status loadmod webadmin + /msg *status loadmod admin + /msg *status loadmod away + /msg *status loadmod awaynick + /msg *status loadmod clientnotify # Notifies when another client logs + /msg *status loadmod keepnick + /msg *status loadmod kickrejoin + ## Away /msg *status loadmod away