Skip to content

Instantly share code, notes, and snippets.

deflexor

Block or report user

Report or block deflexor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View rinkebywallet.txt
0x481fff417ab8b8fd554a373bd462128560909fc4
@deflexor
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
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="https://vk.com/js/api/xd_connection.js?2" type="text/javascript"></script>
<script type="text/javascript">
function onInit() {
console.log("Post ID");
}
VK.init(function() {
// API initialization succeeded
@deflexor
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
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 (
<div>
<h3>Clickouts</h3>
You can’t perform that action at this time.