Skip to content

Instantly share code, notes, and snippets.

View espadrine's full-sized avatar

Thaddée Tyl espadrine

View GitHub Profile
@espadrine
espadrine / color-cheat-golf.js
Last active January 3, 2016 19:09 — forked from jankeromnes/color-cheat-golf.js
Cheat on <http://www.colormunki.com/game/huetest_kiosk>. How to get the best score, how to get the worst score.
for(j=8;j++<88;)eval('a=patch_'+(j%4+1)+'_'+(j>>2)).parentNode.appendChild(a)
@puffnfresh
puffnfresh / objectunion.js
Last active December 12, 2015 02:28
Creation of unions, with automatic value constructors and an automatic fold encoding.
// Boilerplate
function objectUnion(definer) {
var defined = 0, length = 0, isDefined = false, definitions, key;
definitions = definer(function() {
var names = arguments, fold;
if(isDefined) {
throw new TypeError('This objectUnion has already been defined');
}
function Ctor() {}
@jeromeetienne
jeromeetienne / node-ssl-server.js
Created August 6, 2010 09:44
example of node.js ssl server
// You can generate the privatekey.pem and certificate.pem files using the following commands:
//
// openssl genrsa -out privatekey.pem 1024
// openssl req -new -key privatekey.pem -out certrequest.csr
// openssl x509 -req -in certrequest.csr -signkey privatekey.pem -out certificate.pem
const crypto = require('crypto'),
fs = require("fs"),
http = require("http");