Skip to content

Instantly share code, notes, and snippets.

@kushal
kushal / main.go
Last active November 27, 2016 09:34
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
"strconv"
@kushal
kushal / review.sh
Last active January 25, 2021 07:23
#!/bin/bash
set -e
function ynprompt {
read -n 1 -r -p "KEEP GOING? [Y/n] " response
if [[ $response =~ ^([nN])$ ]]
then
exit
fi
** Typical Redux **
dispatch({type: 'SET_DONUT', flavor: 'jelly'})
reduce(state, action) {
...
case SET_DONUT:
return { ...state, flavor: jelly };
}
/**
* @constructor
*/
chartbeat.widgets.IDragger = function(target, handle, limits) {
goog.fx.Dragger.call(this, target, handle, limits);
if (goog.userAgent.MOBILE) {
target.addEventListener('touchstart', goog.bind(this.startDragTouch, this));
}
};
goog.inherits(chartbeat.widgets.IDragger, goog.fx.Dragger);