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
var s; | |
s = "wtf"; | |
s.split = function () {}; | |
s.split("t"); // split() works | |
s = String("wtf"); | |
s.split = function () {}; | |
s.split("t"); // split() works |
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 profile (o) { | |
for (var key in o) { | |
var field = o[key]; | |
if (typeof field == 'function') { | |
o[key] = Proxy.createFunction({}, | |
// call | |
function () { | |
var before = new Date; | |
var res = field.apply(o, arguments); | |
var spent = new Date - before; |
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
# Upgrading from openwrt backfire to attitude adjustment 12.09 on the routerstation pro | |
# 1. | |
# download the sysupgrade file | |
# it can be used to upgrade from the luci ui | |
# it keeps your settings | |
wget http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/openwrt-ar71xx-generic-ubnt-rspro-squashfs-sysupgrade.bin | |
# 2. | |
# in luci, navigate to "backup / flash firmware" |
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> | |
<meta charset=utf-8> | |
<title>hogan internal access nested context</title> | |
<script src="hogan-3.0.1.js"></script> | |
<script> | |
var data = { | |
site: { | |
heading: "Site heading", |
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> | |
<meta charset=utf-8> | |
<title>hogan custom function access nested context</title> | |
<script src="hogan-3.0.1.js"></script> | |
<script> | |
var data = { | |
site: { | |
heading: "Site heading", |
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> | |
<meta charset=utf-8> | |
<title>hogan custom function access nested context</title> | |
<script src="hogan-3.0.1.js"></script> | |
<script> | |
var data = { | |
site: { | |
heading: "Site heading", |
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
▶ brew list -1 | while read line; do brew unlink $line; brew link $line; done | |
Unlinking /usr/local/Cellar/appledoc/2.2... 0 links removed | |
Linking /usr/local/Cellar/appledoc/2.2... 1 symlinks created | |
Unlinking /usr/local/Cellar/autoconf/2.69... 0 links removed | |
Linking /usr/local/Cellar/autoconf/2.69... 18 symlinks created | |
Unlinking /usr/local/Cellar/bash-completion/1.3... 184 links removed | |
Linking /usr/local/Cellar/bash-completion/1.3... 182 symlinks created | |
Unlinking /usr/local/Cellar/bgrep/0.2... 0 links removed | |
Linking /usr/local/Cellar/bgrep/0.2... 1 symlinks created | |
Unlinking /usr/local/Cellar/binutils/2.24... 49 links removed |
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
var wait = (ms) => new Promise((resolve, reject) => { | |
setTimeout(function () { | |
reject("doh"); | |
}, ms * 1000) | |
}) | |
async function f () { | |
try { | |
await wait(2); | |
} |
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
var React = require('react'); | |
var EventEmitter = require("events").EventEmitter; | |
function component (fn) { | |
var Component = React.createClass({ | |
render: function () { | |
return fn.call(this, this.props.value, this.props.statics); | |
}, | |
shouldComponentUpdate: function (nextProps) { | |
return this.props.value != nextProps.value; |
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
var React = require('react'), | |
component = require('../'), | |
immstruct = require('immstruct'), | |
Immutable = require('immutable'), | |
d3 = require('d3'); | |
var d = React.DOM; | |
var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0), | |
h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0), |