Hammer
+
wrenCh
more like pliers, unfortunately : wrenCh
unit tests
empty
Chart.js
stacking
table
Today's Opinion Poll Question
Political Party
Democrat
Republical
Independant
"Do you favour or oppose increasing the minimum wage?"
Favour
70%
35%
55%
Oppose
25%
60%
30%
Unsure
5%
5%
15%
set cascade generator (v3)
function set(o,v){for(var n in v) o[n]=v[n];return o}
(v1 was function set(o,s){s=function(a,v){o[a]=v;return s};s.o=o;return s}
eg: set(acat)('sound','purrrr')('legs',4) )
(v2 was function set(o){return function s(a,v){o[a]=v;return s}}
eg: set(acat)('sound','purrrr')('legs',4) )
mutate
fake yield
empty
FizzBuzz
Symbols to words tricks
var s = ([]+![])[+!+[]+!+[]+!+[]][([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([][([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([]+[][+!+[]])[+!+[]]+([]+![])[+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+!![])[+!+[]]+([]+!![])[+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([]+!![])[+!+[]]][([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([]+[][+!+[]])[+!+[]]+([]+![])[+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+!![])[+!+[]]+([]+!![])[+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([]+!![])[+!+[]]](([]+!![])[+!+[]]+([]+[][+[]])[+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+!![])[+!+[]+!+[]]+([]+!![])[+!+[]]+([]+[][+!+[]])[+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+(+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[])[([]+{})[+!+[]+!+[]+!+[]+!+[]+...
Standardized DateTime formatting
var id = function(){
var id=0;
function getNextId() { return id++; };
return function(){ return getNextId(); }; }();
optimised from :
get_time = function() {
var date_part, local_time, now, time_part;
local_time = new Date();
now = new Date(local_time.getTime() + (local_time.getTimezoneOffset() * 60000));
date_part = "" + (this.zero_pad(now.getFullYear(), 2)) + "-" + (this.zero_pad(now.getMonth() + 1, 2)) + "-" + (this.zero_pad(now.getDate(), 2));
time_part = "" + (this.zero_pad(now.getHours(), 2)) + ":" + (this.zero_pad(now.getMinutes(), 2)) + ":" + (this.zero_pad(now.getSeconds(), 2));
return "" + date_part + " " + time_part; };
zero_pad = function(number, length) {
var str;
str = "" + number;
while (str.length < length) str = "0" + str;
return str; };
to :
Date.prototype.ymd = function getYMD() {
function p2(s) { return ("0" + s).slice(-2) }
function p4(s) { return ("000" + s).slice(-4) }
return [p4(this.getFullYear()), p2(this.getMonth()+1), p2(this.getDate())].join("-") +
" " +
[p2(this.getHours()),p2(this.getMinutes()),p2(this.getSeconds())].join(":"); };
to :
Date.prototype.ymd = function getYMD(d) {
var d = d || this;
function p2(s) { return ("0"+s).slice(-2) }
return [d.getFullYear(),p2(d.getMonth()+1),p2(d.getDate())].join("-") +
" "+[p2(d.getHours()),p2(d.getMinutes()),p2(d.getSeconds())].join(":") };
compacted:
Date.prototype.ymd=function ymd(d){d=d||this;function p(s){return("0"+s).slice(-2)}
return[d.getFullYear(),p(d.getMonth()+1),p(d.getDate())].join("-")+" "+
[d.getHours(),d.getMinutes(),d.getSeconds()].map(p).join(":")};
most efficient, but less fun:
Date.prototype.ymd=function ymd(d){d=d||this;function p(s){return('0'+s).slice(-2)}
return d.getFullYear()+'-'+p(d.getMonth()+1)+'-'+p(d.getDate())+' '+
p(d.getHours())+':'+p(d.getMinutes())+':'+p(d.getSeconds())};
messagebox
Are you sure you want to answer this question? cancelyes, Yes i do