- code examples
- [try it live](https://babeljs.io/repl/#?experimental=false&evaluate=true&loose=false&spec=false&code=let%20dynamic%20%3D%201%0A%0Aclass%20a%20%7B%0A%20%20constructor()%7B%0A%20%20%20%20this.letter%20%3D%20'a'%0A%20%20%7D%0A%20%20method()%7B%0A%20%20%20%20this.triggered%20%3D%20true%0A%20%20%7D%0A%20%20static%20bumpDynamics%20()%7B%0A%20%20%20%20dynamic%2B%2B%0A%20%20%7D%0A%20%20%5Bdynamic%5D()%7B%0A%20%20%20%20return%20false%0A%20%20%7D%0A%7D%0A%0Aclass%20b%20extends%20a%20%7B%0A%20%20constructor()%7B%0A%20%20%20%20super()%0A%20%20%7D%0A%20%20method()%7B%0A%20%20%20%20super.method()%0A%20%20%20%20this.parentTriggered%20%3D%20true%0A%20%20%7D%0A%7D%0A%0Aclass%20c%20extends%20Array%20%7B%0A%20%20push(...args)%7B%0A%20%20%20%20args.forEach((arg)%20%3D%3E%20%7B%0A%20%20%20%20%20%20if%20(arg%20instanceof%20Error)%7B%0A%20%20%20%20%20%20%20%20throw%20new%20Error('you%20can%5C't%20put%20errors%20here!')%0A%20%20%20%20%20%20%7D%0
- es6 friendly – this means no mixins
- immutable friendly
- no promises, because debugging them sucks
- es6 friendly
"bin"
in package.json- keeping
index.js
andbin/module
separate. You want both programmatic and cli access - use
yargs
to parse options from the CLI. You can do this manually, but it's painful and error prone.yargs
also helps you build a good UI. - make sure to set the
"main"
field
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
"note6": "cirlce ci gives us the ability to run set-npm-token before npm i, heroku does not, so we have to detect the heroku env and manually run npm install because changing .npmrc from an npm hook isn't pick up until the next run of npm", | |
"set-npm-token": "if [ -n \"${NPM_TOKEN-}\" ]; then echo \"//registry.npmjs.org/:_authToken=$NPM_TOKEN\" >> .npmrc; fi", | |
"preinstall": "npm run set-npm-token && if [ -n \"${DEPLOY_ENV-}\" ]; then echo installing; npm install --unsafe-perm --userconfig .npmrc --ignore-scripts; fi", | |
"postinstall": "if [ -n \"${DEPLOY_ENV-}\" ]; then npm run build; fi" |
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
/* Clickable elements | |
*/ | |
// when any .clickable elem is clicked, we'll grab the first link in the elem and redirect to it. | |
$('body').on('click', '.clickable', function(e){ | |
var link = $('a:first', this) | |
, href = link.attr('href') | |
// _blank, command key, ctrl key, middle click | |
if (link.attr('target') == '_blank' || e.metaKey || e.ctrlKey || e.which == 2) | |
window.open(href, '_blank') |
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
alias tolf="find . -type f -not -iname '*.png' -not -iname '*.jpg' -not -iname '*.jpeg' -not -iname '*.gif' -not -iname '*.tif' -not -iname '*.tiff' -not -iname '.git' -exec perl -pi -e 's/\r\n?/\n/g' {} \;" |
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
# add this to your .bash_profile | |
# usage: gitinstall http://github.com/path/to/git.git | |
function gitinstall(){ git init; git remote add origin "$@"; git config branch.master.remote origin; git config branch.master.merge refs/heads/master; git pull;} |
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
/* | |
Copyright (c) 2010, Patrick Wied. All rights reserved. | |
Code licensed under the BSD License: | |
http://patrick-wied.at/static/license.txt | |
*/ | |
var heatmapApp = (function(){ | |
// var definition | |
// canvas: the canvas element | |
// ctx: the canvas 2d context | |
// width: the heatmap width for border calculations |
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
<!doctype html> | |
<title>Image-free spinner</title> | |
<style> | |
@-webkit-keyframes fadeOut { | |
0% { opacity:1; } | |
100% { opacity:.1; }} | |
p { | |
position:absolute; | |
overflow:hidden; | |
top:50%; |
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
<files wp-config.php> | |
order allow,deny | |
deny from all | |
</files> | |
Options +FollowSymLinks | |
RewriteEngine On | |
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR] | |
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR] | |
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) | |
RewriteRule ^(.*)$ index.php [F,L] |