Update
This commit is contained in:
parent
74c9c21796
commit
00982adb13
|
@ -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
|
||||||
|
|
6
sed.md
6
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
|
sed -i '' -e 's/foo/bar/' example.md
|
||||||
|
|
||||||
|
|
||||||
### GNU/sed
|
### GNU/sed
|
||||||
|
|
||||||
To do in place replacements use `-i` without arg
|
To do in place replacements use `-i` without arg
|
||||||
|
@ -18,11 +17,14 @@ To do in place replacements use `-i` without arg
|
||||||
|
|
||||||
### Yes
|
### Yes
|
||||||
|
|
||||||
|
|
||||||
Print until a certain line is met
|
Print until a certain line is met
|
||||||
|
|
||||||
sed '/begin api/q'
|
sed '/begin api/q'
|
||||||
|
|
||||||
|
Print until a certain line is met, but not that line
|
||||||
|
|
||||||
|
sed '/^# begin/,$d'
|
||||||
|
|
||||||
Print everything after a given line
|
Print everything after a given line
|
||||||
|
|
||||||
sed -n '/end api/,$p'
|
sed -n '/end api/,$p'
|
||||||
|
|
|
@ -38,19 +38,28 @@ Create the file `scripts/deploy-to-gh-pages.sh`
|
||||||
```
|
```
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# See https://medium.com/@nthgergo/publishing-gh-pages-with-travis-ci-53a8270e87db
|
# 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 public
|
||||||
rm -rf out || exit 0
|
mkdir public
|
||||||
mkdir out
|
|
||||||
|
|
||||||
# build
|
# config
|
||||||
node build.js
|
git config --global user.email "nobody@nobody.org"
|
||||||
|
git config --global user.name "Travis CI"
|
||||||
|
|
||||||
|
# build (CHANGE THIS)
|
||||||
|
make
|
||||||
|
|
||||||
# deploy
|
# deploy
|
||||||
( cd out
|
cd public
|
||||||
git init
|
git init
|
||||||
git add .
|
git add .
|
||||||
git commit -m "Deploy to Github Pages" --author "Travis CI <nobody@nobody.org>"
|
git commit -m "Deploy to Github Pages"
|
||||||
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1
|
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
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue