Skip to content

Instantly share code, notes, and snippets.

View dan-mckay's full-sized avatar

Daniel McKay dan-mckay

View GitHub Profile
@busypeoples
busypeoples / UnderstandingReducer.re
Last active November 11, 2018 15:22
Understanding Reducer in ReasonML
let se = ReasonReact.stringToElement;
type state = int;
type actions =
| Inc
| IncWithSideEffect
| SideEffect
| DoNothing
| SilentIncUpdate
@cezarneaga
cezarneaga / Workshop Handout.md
Last active November 23, 2017 19:22
a sum-up of recorded knowhow

Reason Workshop @ReactiveConf 2017

by: Sean Grove, Jared Forsyth, Daniel Woelfel
support team: Cristiano Calcagno, @reasonvienna - @ryyppy @svensauleau @cezarneaga and @nikgraf in spirit, @matystl, @MyNaartjie

Support and Questions: Join discord channel

Workshop Presentation

  • workshop flow and exercises
// Author : Prathap Reddy SV
var LStorage = (function () {
function LStorage() {
this.localStorage = JSON.parse(JSON.stringify(localStorage));
// or new Function("return JSON.parse('" + JSON.stringify(localStorage) + "')")();
}
LStorage.prototype.setItem = function (key, val) {
if(this.localStorage[key] == val) return;
this.localStorage[key] = val;
@brianloveswords
brianloveswords / eff-you-region-lock.md
Last active December 22, 2015 15:08
Defeating region lock

Prerequisites

  • Somewhat modern version of OpenSSH
  • Server you have SSH access to in the region you want to stream from.

Bummed about region lock? Start up your terminal and do this:

$ ssh -N -D 9999 yourserver.com
@PanosJee
PanosJee / underscore.examples.js
Created July 7, 2011 15:33
Some nice examples of Underscore.js
// Collecting all unique affected app version for a given data set
var jsonStats = [
{app_versions: ['1.2','1.2.3']},
{app_versions: null},
{app_versions: ['1.2','1.3']}
];
var app_versions = _.uniq(_.flatten(_.compact(_.map(jsonStats, function(day){return day.app_versions }))));
// ["1.2", "1.2.3", "1.3"]
// Bye bye stupid for loops!