- $0 - The name of the Bash script.
- $1 - $9 - The first 9 arguments to the Bash script. (As mentioned above.)
- $# - How many arguments were passed to the Bash script.
- $@ - All the arguments supplied to the Bash script.
- $* - All the arguments supplied to the Bash script seperated by the IFS.
- $? - The exit status of the most recently run process.
- $$ - The process ID of the current script.
- $USER - The username of the user running the script.
- $HOSTNAME - The hostname of the machine the script is running on.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import request from 'superagent'; | |
import cheerio from 'cheerio'; | |
import vo from 'vo'; | |
import {readFile} from 'fs'; | |
/** | |
* An example generator | |
*/ | |
function *gen(init) { | |
//confusing because what is stored in `first` variables is not what is returned from |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const requireTest = require.context('./test', true, /_test\.js$/); | |
requireTest.keys().forEach(requireTest); //stolen directly from @shama |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const transportationList = ( | |
<ul> | |
<li>Armored Car</li> | |
<li className="active">Hyperloop</li> | |
</ul> | |
); | |
ReactDOM.render( | |
transportationList, | |
document.getElementById(‘app’) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.even { | |
background-color: lavenderblush; | |
} | |
.odd { | |
background-color: goldenrod; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.even { | |
background-color: lavenderblush; | |
} | |
.odd { | |
background-color: goldenrod; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HOC and context | |
// provide context with HOC | |
import App from './components/App'; | |
import ProvideContext from './containers/ProvideContext'; | |
const transportationTypes = [ | |
'armored car', | |
'fire engine', | |
'golf cart', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git ls-remote https://github.com/docker/compose | grep refs/tag | grep -o "[0-9]\.[0-9]\{1,2\}\.[0-9]\{1,2\}$" | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | tail -n 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function *foo(x) { | |
var y = 2 * (yield (x + 1)); | |
var z = yield (y / 3); | |
return (x + y + z); | |
} | |
//this "instantiates" (not sure if this is correct??) the generator | |
//and returns an object with a `next` method | |
var it = foo( 5 ); |