Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
the | |
of | |
to | |
and | |
a | |
in | |
is | |
it | |
you | |
that |
var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' + | |
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' + | |
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' + | |
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));'; | |
try { | |
eval(str); | |
} catch(e) { | |
alert('Your browser does not support ES6!') | |
} |
Object.getOwnPropertyDescriptors = function getOwnPropertyDescriptors(obj) { | |
var descriptors = {}; | |
for (var prop in obj) { | |
if (obj.hasOwnProperty(prop)) { | |
descriptors[prop] = Object.getOwnPropertyDescriptor(obj, prop); | |
} | |
} | |
return descriptors; | |
}; |
IMAGE_MAGIC = { | |
'JPG' => 'ffd8', | |
'BMP' => '424d', | |
'TIFF-LE' => '49492a00', | |
'TIFF-BE' => '4d4d002a', | |
'GIF87a' => '474946383761', | |
'GIF89a' => '474946383961', | |
'PNG' => '89504e470d0a1a0a', | |
}.freeze | |
IMAGE_MAGIC_LEN = (IMAGE_MAGIC.values.map(&:size).max / 2.0).ceil |
const kCRCTable = new Int32Array([ | |
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, | |
0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, | |
0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, | |
0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, | |
0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, | |
0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, | |
0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, | |
0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, | |
0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, |
// c++ -o nanopng nanopng.cpp && ./nanopng /tmp/foo.png | |
#include <cstdio> | |
// write an uncompressed PNG file from a uint8 RGB buffer | |
struct Png { | |
FILE*f; unsigned int tab[256], crc; ~Png() { fclose(f); } | |
Png(const char* fn, int w, int h, const unsigned char* c) { | |
crc=0x575e51f5;unsigned char d[]={137,80,78,71,13, | |
10,26,10,0,0,0,13,73,72,68,82,73,68,65,84,120,1,0, | |
0,0,73,69,78,68,174,66,96,130};/*chunk headers*/ |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
Includes HTTP-Header information in the output
const net = require('net'); | |
const exec = require('child_process').exec; | |
const os = require('os'); | |
function run(cmd) { | |
return new Promise((resolve, reject) => { | |
exec(cmd, (err, stdout) => { | |
if (err) { | |
return reject(err); | |
} |
/* | |
* Easing Functions - inspired from http://gizma.com/easing/ | |
* only considering the t value for the range [0, 1] => [0, 1] | |
*/ | |
EasingFunctions = { | |
// no easing, no acceleration | |
linear: function (t) { return t }, | |
// accelerating from zero velocity | |
easeInQuad: function (t) { return t*t }, | |
// decelerating to zero velocity |