Douglas Crockford
"The Better Parts" (2014)
https://vimeo.com/97419177
https://www.youtube.com/watch?v=bo36MrBfTk4
- Proper tail calls
- Splat operator (rest and spread)
- Modules
Number.prototype.toBinary = function(){ | |
return parseInt(this.toString(2)); | |
}; | |
// > (55).toBinary() | |
// > 110111 | |
{ | |
"vars": { | |
"@gray-base": "#000", | |
"@gray-darker": "lighten(@gray-base, 13.5%)", | |
"@gray-dark": "lighten(@gray-base, 20%)", | |
"@gray": "lighten(@gray-base, 33.5%)", | |
"@gray-light": "lighten(@gray-base, 46.7%)", | |
"@gray-lighter": "lighten(@gray-base, 93.5%)", | |
"@brand-primary": "darken(#428bca, 6.5%)", | |
"@brand-success": "#5cb85c", |
/*global CodeMirror */ | |
function indexOf(string, pattern, from) { | |
if (typeof pattern === "string") { | |
var found = string.indexOf(pattern, from); | |
return found; | |
} | |
var m = pattern.exec(from ? string.slice(from) : string); | |
return m ? (m.index + from) : -1; | |
} |
type floatPointType = {x: float, y: float}; | |
type intPointType = {x: int, y: int}; | |
type wCoordType = | |
| WCoord floatPointType; | |
type gCoordType = | |
| GCoord intPointType; |
Douglas Crockford
"The Better Parts" (2014)
https://vimeo.com/97419177
https://www.youtube.com/watch?v=bo36MrBfTk4
#! /usr/bin/env bash | |
# Quickly add an upstream remote repo from Github. | |
git_dir_path=`git rev-parse --show-toplevel` | |
repo_name=`basename ${git_dir_path}` | |
echo "Setting upstream to ${1}/${repo_name}" | |
git remote add upstream https://github.com/"$1"/"$repo_name".git |
// put this at the top of your app | |
const setState = Component.prototype.setState | |
Component.prototype.setState = function(nextState) { | |
console.group(this.constructor.name) | |
console.trace() | |
if (this.shouldComponentUpdate) { | |
console.log('shouldComponentUpdate', ( | |
this.shouldComponentUpdate(this.props, nextState) | |
)) | |
} |
You must provide the following configuration variables:
WP_XMLRPC_URL
= https://www.yourdomain.com/xmlrpc.php
(replace with your domain and use http:// if you don't have SSL support)WP_ADMIN_USER
= admin
(use your own admin username)WP_ADMIN_PASSWORD
= somepassword
(use your own admin password)--- Raw source --- | |
function add(a, b){ | |
return a + b; | |
} | |
print(add(15, 19)); | |
for (var i=0;i<1000;i++){ | |
add(i, 22); | |
} |