Skip to content

Instantly share code, notes, and snippets.

View hello gist
(function () {
$=~[];$={___:++$,$$$$:(![]+"")[$],__$:++$,$_$_:(![]+"")[$],_$_:++$,$_$$:({}+"")[$],$$_$:($[$]+"")[$],_$$:++$,$$$_:(!""+"")[$],$__:++$,$_$:++$,$$__:({}+"")[$],$$_:++$,$$$:++$,$___:++$,$__$:++$};$.$_=($.$_=$+"")[$.$_$]+($._$=$.$_[$.__$])+($.$$=($.$+"")[$.__$])+((!$)+"")[$._$$]+($.__=$.$_[$.$$_])+($.$=(!""+"")[$.__$])+($._=(!""+"")[$._$_])+$.$_[$.$_$]+$.__+$._$+$.$;$.$$=$.$+(!""+"")[$._$$]+$.__+$._+$.$+$.$$;$.$=($.___)[$.$_][$.$_];$.$($.$($.$$+"\""+$.$_$_+(![]+"")[$._$_]+$.$$$_+"\\"+$.__$+$.$$_+$._$_+$.__+"(\\\"\\"+$.__$+$.__$+$.$_$+"\\"+$.__$+$.$$$+$.__$+" \\"+$.__$+$.___+$.$$_+"\\"+$.__$+$.$_$+$.__$+"\\"+$.__$+$.$$_+$._$_+"\\"+$.__$+$.$$_+$._$$+$.__+" \\"+$.__$+$.___+$.$$$+"\\"+$.__$+$.$_$+$.__$+"\\"+$.__$+$.$$_+$._$$+$.__+"!\\\")"+"\"")())();
});
View gist:635299
function B() {
var x;
if (s) {
x = 0;
} else if (w) {
x = 14;
} else {
x = 7;
}
return r < 20*(x+t);
View RDC.js
var Entity = function (type, pos, obj) {
this.type = type;
this.pos = pos;
this.obj = obj;
}
var RDC = function (collide) {
this.collide = collide;
}
RDC.SUBDIVISION_THRESHOLD = 4;
View rename.js
var sys = require('sys'),
fs = require('fs');
(function (dir) {
var search = arguments.callee;
fs.readdir(dir, function (err, files) {
if (files === undefined) return false;
files.forEach(function (file) {
View gist:740420
var sys = require('sys'),
fs = require('fs');
(function (dir) {
var search = arguments.callee;
fs.readdir(dir, function (err, files) {
if (files === undefined) return false;
files.forEach(function (file) {
View joi-2009-1.js
var fs = require('fs'),
sys = require('sys');
fs.readFile('1.txt', "utf-8", function (err, data) {
data.split('\n').forEach(function (val, i) {
if (i == 0) {
all = val;
} else {
all -= val;
}
View joi-2009-2.js
var fs = require('fs'),
sys = require('sys');
fs.readFile('1.txt', "utf-8", function (err, data) {
data = data.split('\n');
var nm = data[0].split(' '),
n = +nm[0],
m = +nm[1],
step = 1,
steps = data.slice(1, n+1),
View joi-2009-3.js
var fs = require('fs'),
sys = require('sys');
Array.prototype.unique = function () {
var o = {},
r = [];
for (var i = 0;i < this.length;i++)
if (this[i] in o? false: o[this[i]] = true)
r.push(this[i]);
return r;
View joi-2010-1.js
var fs = require('fs'),
sys = require('sys');
var result = function (file) {
fs.readFile(file, "utf-8", function (err, data) {
time = 0;
data = data.split('\n').forEach(function (val, i) {
time += +val
})
r = parseInt((time/60))+'\n'+(time%60)
View joi-2010-2.js
var fs = require('fs'),
sys = require('sys');
var result = function (file) {
fs.readFile(file, "utf-8", function (err, data) {
err && sys.print(err)
var search = '';
var r = 0;
data.split('\r\n').forEach(function (val, i) {
You can’t perform that action at this time.