From 00982adb13de344cc892d75e1c7489c06eb7abf6 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Tue, 20 Jan 2015 23:10:15 +0800 Subject: [PATCH] Update --- es6.md | 59 ++++++++++++++++++++++++++++++++++++++++++++++ sed.md | 6 +++-- travis-gh-pages.md | 31 +++++++++++++++--------- 3 files changed, 83 insertions(+), 13 deletions(-) create mode 100644 es6.md diff --git a/es6.md b/es6.md new file mode 100644 index 000000000..98a48cd9e --- /dev/null +++ b/es6.md @@ -0,0 +1,59 @@ +--- +title: ES6 +layout: default +--- + +## Stable + +New features you can use on io.js. + +### Promises + + new Promise(fn) + .then(fn) + .catch(fn) + + Promise.all(...) + Promise.race(...) + Promise.reject(...) + Promise.resolve(...) + +### [Template strings](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template_strings) + + var message = `Hello there ${name}`; + +### [Block scoping](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let) + + if (true) { + let x = 1; + } + +### [Constants](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const) + + const a = 1; + +### Generators + + function*() {...} + +### Binary/octal + + var bin = 0b1010010; + var oct = 0755; + +### String methods + + "hello".repeat(3) + "hello".contains("ll") + "\u1E9B\u0323".normalize("NFC") + +### [Symbols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) + + var sym = Symbol("foo") + typeof sym === 'symbol' + +### [Collections](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) + + Map, WeakMap + Set, WeakSet + diff --git a/sed.md b/sed.md index 5bb9af437..f4d27d87b 100644 --- a/sed.md +++ b/sed.md @@ -9,7 +9,6 @@ To do in place replacements `-i ''` is required (GNU/sed is different) sed -i '' -e 's/foo/bar/' example.md - ### GNU/sed To do in place replacements use `-i` without arg @@ -18,11 +17,14 @@ To do in place replacements use `-i` without arg ### Yes - Print until a certain line is met sed '/begin api/q' +Print until a certain line is met, but not that line + + sed '/^# begin/,$d' + Print everything after a given line sed -n '/end api/,$p' diff --git a/travis-gh-pages.md b/travis-gh-pages.md index eb1c1e5e1..2f4464943 100644 --- a/travis-gh-pages.md +++ b/travis-gh-pages.md @@ -38,19 +38,28 @@ Create the file `scripts/deploy-to-gh-pages.sh` ``` #!/bin/bash # See https://medium.com/@nthgergo/publishing-gh-pages-with-travis-ci-53a8270e87db +set -o errexit -if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "master" ]; then exit 0; fi -rm -rf out || exit 0 -mkdir out +rm -rf public +mkdir public -# build -node build.js +# config +git config --global user.email "nobody@nobody.org" +git config --global user.name "Travis CI" + +# build (CHANGE THIS) +make # deploy -( cd out - git init - git add . - git commit -m "Deploy to Github Pages" --author "Travis CI " - git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1 -) +cd public +git init +git add . +git commit -m "Deploy to Github Pages" +git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1 +``` + +From Ractive: + +``` +if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "master" ]; then exit 0; fi ```