I hereby claim:
- I am segdeha on github.
- I am segdeha (https://keybase.io/segdeha) on keybase.
- I have a public key ASAHfqvOme4nKsxgAglMCDbROQQ_DebYzZ2XEOGz3k7A0Qo
To claim this, I am signing this object:
function Timer() { | |
this.start = +new Date | |
} | |
Timer.prototype.stop = function () { | |
this.stop = +new Date | |
this.elapsed = '<em>Elapsed: ' + (this.stop - this.start) + 'ms</em>' | |
} |
// based on: http://snipt.org/rpp (which seems now defunct) | |
function Template(str) { | |
this.rgx = /{{([^{}]*)}}/g | |
this.str = str || '' | |
} | |
Template.prototype.evaluate = function (vals) { | |
vals = vals || {} | |
function repr(str, match) { | |
return 'string' === typeof vals[match] || 'number' === typeof vals[match] ? vals[match] : str | |
} |
function p(u,p,c){var x=new XMLHttpRequest;x.open('POST',u);x.setRequestHeader('Content-type','application/x-www-form-urlencoded');x.onreadystatechange=function(){3<x.readyState&&c(x)};x.send(p)} |
bob = [ | |
['a', 'b'], | |
['c', 'd'], | |
['e', 'f', 'g'], | |
['i'], | |
['j', 'k'], | |
['l', 'm'], | |
['n'] | |
] |
/** | |
* Returns a function that composes strings from ES6 template literals. | |
* Based on http://stackoverflow.com/a/22619256/11577 | |
* | |
* @usage formatter`${0}, ${1}!`.format('Hello', 'world') // -> 'Hello, world!' | |
* | |
* @param array<string> literals Array of string literals | |
* @param array<mixed> substitutions Rest parameter of substitution values | |
* | |
* @return function |
I hereby claim:
To claim this, I am signing this object:
let arr = ['a', 'b', 'c']; | |
for (const [i, x] of arr.entries()) { | |
console.log(i, x); | |
} | |
arr.forEach((x, i ) => { | |
console.log(i, x); | |
}); |
javascript:(function(){Array.from(document.querySelectorAll('.canvas-yahoovideo,iframe,video')).forEach(video=>video.parentNode.removeChild(video));Array.from(document.querySelectorAll('*')).filter(node=>window.getComputedStyle(node).position==='fixed').forEach(node=>node.style.display='none');}()); |
let name = 'diane'; | |
let name_capitalised = name.slice(0, 1).toUpperCase() + | |
name.slice(1, name.length).toLowerCase(); | |
alert(`Hi ${name_capitalised}. You are pretty cool!`); |
const capitalise = name => name.slice(0, 1).toUpperCase() + | |
name.slice(1, name.length).toLowerCase(); | |
let name = 'diane'; | |
alert(`Hi ${capitalise(name)}. You are pretty cool!`); |