Skip to content

Instantly share code, notes, and snippets.

View n6g7's full-sized avatar
❄️

Nathan Gaberel n6g7

❄️
View GitHub Profile
@jevakallio
jevakallio / reactiveconf-slam-poetry.md
Last active July 7, 2021 19:57
#ReactiveConf 2017 Lightning Talk Submission: JavaScript Slam Poetry

TL;DR: If you want to see me perform a spoken word poem about JavaScript in front of 1000 people (and on video), please ⭐ star this gist. If you're on mobile, you'll need to request desktop site.

JavaScript Slam Poetry

Javascript! Slam! Poetry!

@gaearon
gaearon / slim-redux.js
Last active May 5, 2024 15:14
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@ryonlife
ryonlife / braintree_patch.py
Created February 9, 2012 00:42
Monkey patch Braintree's Python API wrapper so results/responses are serializable.
from types import MethodType
import braintree
import jsonpickle
import json
def serialize(self):
""" Serialize a Braintree SuccessfulResult or ErrorResult object to a Python dict """
return json.loads(jsonpickle.encode(self))
braintree.ErrorResult.serialize = MethodType(serialize, None, braintree.ErrorResult)