Skip to content

Instantly share code, notes, and snippets.

View rinkebywallet.txt
deflexor / expo.js
Created Feb 12, 2017
Write a recursive exponential backoff service (ping) check.
View expo.js
const http = require('http');
const RetryIntervals = [500, 1000, 4000];
const retryTries = 4;
function pingService(retryInterval, retryTry) {
if(retryTry >= retryTries) {
console.log(`ping not ok after ${retryTries} retries, giving up.`);
deflexor / bind.js
Created Feb 12, 2017
Rewrite the bind method from scratch.
View bind.js
function mybind(f, o) {
return function() {
return f.apply(o, arguments);
View i.html
<script src="" type="text/javascript"></script>
<script type="text/javascript">
function onInit() {
console.log("Post ID");
VK.init(function() {
// API initialization succeeded
deflexor / Main.hs
Created Nov 14, 2015
stack runghc Main.hs
View Main.hs
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Debug.Trace (trace, traceM, traceStack, traceShowM)
import Control.Applicative
import Control.Monad (unless, forM_, forM, void, mzero)
import Data.Char (isAlpha, isAlphaNum)
import qualified Text.Parsec as P
import Text.Parsec.Text
deflexor / app.elm
Last active Oct 14, 2015
Elm-lang app that needs speed boost
View app.elm
import Html exposing (..)
import Debug exposing (..)
import Array exposing (Array, repeat, set, get, toList, initialize)
import Html.Attributes exposing (..)
import Html.Events exposing (on, onClick, targetChecked)
import Signal exposing (Address)
import StartApp.Simple as StartApp
main =
View gist:9406463
/** @jsx React.DOM */
var MyComponent = React.createClass({
render: function() {
// Defaults in case the props are undefined. We'll have a solution for this
// soon that is less awkward.
var perMinute = this.props.perMinute || '-';
var perDay = this.props.perDay || '-';
return (
You can’t perform that action at this time.