Skip to content

Instantly share code, notes, and snippets.

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!')
}
@stormpat
stormpat / my_app.ex
Created June 9, 2016 09:17 — forked from alanpeabody/my_app.ex
Websockets in Elixir with Cowboy and Plug
defmodule MyApp do
use Application
def start(_type, _args) do
import Supervisor.Spec, warn: false
children = [
Plug.Adapters.Cowboy.child_spec(:http, MyApp.Router, [], [
dispatch: dispatch
])
@stormpat
stormpat / destructuring.md
Created March 31, 2016 15:19 — forked from yang-wei/destructuring.md
Elm Destructuring (or Pattern Matching) cheatsheet

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))

let
  (a,b,c) = myTuple
@stormpat
stormpat / helpers.js
Created March 17, 2016 10:35
Helper functions not deserving a library.
// Make it easier to transform an object.
const transform = (object, fn) =>
Object.keys(object).reduce((resulting, key) =>
Object.assign(resulting, {
[key]: fn(object[key])
}),
{}
);
[ { municipality: 'Uusimaa',
zipCodes:
[ '07230',
'07500',
'07510',
'07530',
'07580',
'07590',
'07680',
'02100',

Keybase proof

I hereby claim:

  • I am stormpat on github.
  • I am stormpat (https://keybase.io/stormpat) on keybase.
  • I have a public key whose fingerprint is 219A 3827 BB12 8592 CB72 CB19 2DD1 595E 03E7 3BD4

To claim this, I am signing this object:

@stormpat
stormpat / gist:9563736
Last active August 29, 2015 13:57
HHVM Build
$ brew install hhvm --verbose
==> Downloading https://github.com/facebook/hhvm/archive/HHVM-2.4.2.tar.gz
Already downloaded: /Library/Caches/Homebrew/hhvm-2.4.2.tar.gz
==> Verifying hhvm-2.4.2.tar.gz checksum
tar xf /Library/Caches/Homebrew/hhvm-2.4.2.tar.gz
==> Patching
patching file CMake/HPHPFindLibs.cmake
patching file hphp/runtime/ext/gd/libgd/gdft.cpp
==> rm -rf hphp/submodules/folly
==> ln -s /usr/local/opt/folly hphp/submodules/folly