diff --git a/Gemfile b/Gemfile new file mode 100644 index 000000000..053c27dc3 --- /dev/null +++ b/Gemfile @@ -0,0 +1,2 @@ +source 'https://rubygems.org' +gem 'github-pages' diff --git a/Readme.md b/Readme.md new file mode 100644 index 000000000..f944b384f --- /dev/null +++ b/Readme.md @@ -0,0 +1 @@ +:) diff --git a/ansi.md b/ansi.md index 323efd0d8..778ab0b31 100644 --- a/ansi.md +++ b/ansi.md @@ -32,3 +32,8 @@ Colors 5 magenta 6 cyan 7 white + +Stuff + + hide_cursor() { printf "\e[?25l"; } + show_cursor() { printf "\e[?25h"; } diff --git a/jscoverage.md b/jscoverage.md new file mode 100644 index 000000000..13368c16b --- /dev/null +++ b/jscoverage.md @@ -0,0 +1,27 @@ +--- +title: Setting up jscoverage +layout: default +--- + +### Install + + npm i --save-dev jscoverage + +### package.json + +Set up the `coverage` task so you can do `npm run coverage` later. + + "coverage": "./node_modules/.bin/jscoverage YOURFILE.js && env COVERAGE=true ./node_modules/.bin/mocha -R html-cov > coverage.html; rm YOURFILE-cov.js", + +### test/setup.js + +Instead of requiring `YOURFILE.js`, use `-cov.js` when it's necessary. It's +preferred to do this in the test files (rather than the main entry points). + + var cov = (!! process.env.COVERAGE); + global.Mylib = require(cov ? 'mylib' : 'mylib-cov'); + +### Run + + npm run coverage + open coverage.html diff --git a/sh.md b/sh.md index 679417264..91aaa4d48 100644 --- a/sh.md +++ b/sh.md @@ -202,6 +202,14 @@ or ;; esac +### Source relative + + source "${0%/*}/../share/foo.sh" + +### printf + + printf "Hello %s, I'm %s" Sven Olga + References ---------- diff --git a/webpack.md b/webpack.md new file mode 100644 index 000000000..414e586ea --- /dev/null +++ b/webpack.md @@ -0,0 +1,24 @@ +--- +title: Webpack +layout: default +--- + +### Config + +* webpack.config.js + +### Multiple entries + + entry: { + app: './app.js', + vendor: './vendor.js' + } + +### Output + + output: { + path: __dirname + '/public/assets', + filename: '[name].js' + /* also: [id] [hash] */ + chunkFilename: "[id].chunk.js" + }