Skip to content

Instantly share code, notes, and snippets.

@OliverJAsh
OliverJAsh / index.js
Last active October 19, 2017 17:45
Hide likes from Twitter Lite timeline
"use strict";
// https://github.com/gcanti/fp-ts/blob/eec336fada51bf34f7e68592fe1dc348ca5ef873/src/function.ts#L127
const pipe = (...fns) => (seed) => fns.reduce((val, fn) => fn(val), seed);
const isNotUndefined = (maybeT) => maybeT !== undefined;
const mapMaybe = (f, maybeT) => isNotUndefined(maybeT) ? f(maybeT) : maybeT;
const normalizeMaybe = (nullMaybe) => nullMaybe === null ? undefined : nullMaybe;
const forEachMaybe = (f, maybeT) => {
if (isNotUndefined(maybeT))
f(maybeT);
};
@hobelinm
hobelinm / languageselector.js
Last active October 19, 2017 17:35
Simple language selector to apply language changes to a page
$(document).ready(function(){
// Set appropriate language by default
if (localStorage.languageSelection) {
if(localStorage.languageSelection == "spanish") {
$(".spanish").show();
$(".english").hide();
}
else {
localStorage.languageSelection = "english";
$(".english").show();