Skip to content

Instantly share code, notes, and snippets.

View blitzrk's full-sized avatar

Ben Krieger blitzrk

View GitHub Profile

Keybase proof

I hereby claim:

  • I am blitzrk on github.
  • I am b_ (https://keybase.io/b_) on keybase.
  • I have a public key ASCx9FKsfVa4_Yutn6lqtlzwqAfw-YX2BkthYQBuOILV7go

To claim this, I am signing this object:

@blitzrk
blitzrk / ReorderList.elm
Created May 25, 2016 18:34
Reorderable List in Elm
import Html exposing (..)
import Html.App as Html
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Json.Decode as Json
import Mouse exposing (Position)
main =
@blitzrk
blitzrk / Budget.elm
Last active May 19, 2016 03:00
Simple Monthly Budget List in Elm
import Debug
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.App as App
import Html.Events exposing (onClick, onInput, onBlur)
import Result
import String
import Task
@blitzrk
blitzrk / Calendar.elm
Last active May 16, 2016 18:22
Single Month Calendar Selector in Elm
module Calendar exposing (..)
import Date exposing (Date)
import Debug
import Html as H exposing (..)
import Html.App as Html
import Html.Attributes exposing (..)
import Html.Events exposing (onClick)
import String
import Task
@blitzrk
blitzrk / git_svn_sync.sh
Last active March 11, 2016 19:23
Bash (>=4.0) script for syncing SVN to git repo
#!/bin/bash
usage="\
Sync svn repo to git repo in working dir or PATH
Usage: svn-sync.sh [OPTION]... [PATH]
Options:
-h, --help: Show this help and exit
-t, --tags: Import tags as well as branches
-v, --verbose: Show verbose output
@blitzrk
blitzrk / GameOfLife.elm
Created January 7, 2016 21:29
Cellular automata playground made in 2.5 days. For use in http://elm-lang.org/try and a good starting off point for making your own automatons with unique rules. Obviously could use some refactoring into separate modules for outside the browser...
import Array exposing (Array(..), append, get, set, length)
import Color exposing (black, white, darkGrey)
import Graphics.Element exposing (..)
import Html exposing (..)
import Html.Attributes as Attr exposing (..)
import Html.Events exposing (..)
import Maybe exposing (withDefault, andThen)
import Mouse
import Random exposing (generate)
import Result
@blitzrk
blitzrk / ElmCompilerBug.elm
Created January 6, 2016 14:39
Code compiles, but the circular dependency of the two signals causes foldp to receive an 'undefined' input signal in the JS. Should be a compilation error.
import Graphics.Element exposing (show, Element)
import Mouse
-- VIEW
main : Signal Element
main =
Signal.map view model
import String
import Result exposing (andThen)
import Text
import Color
import Html exposing (..)
import Html.Attributes as Attr exposing (..)
import Html.Events exposing (..)
-- View
@blitzrk
blitzrk / RandomExtras.elm
Last active December 10, 2015 18:49
Elm Random Permutation Proposal Raw
-- module Random.Extras (Generator, generate, permutation) where
import Random
import Graphics.Element exposing (show, Element)
import Time exposing (Time)
{-| Must redefine Random.Generator type because Random.Generator(Generator)
is not exposed.
-}
type Generator a =
@blitzrk
blitzrk / pairheap.py
Last active November 10, 2015 20:44
Python 3 pairing heap implementation with decrease-key
# Pairing heap implementation with decrease-key functionality
class Wrapper:
"""
A wrapper for maintaining a reference to the root of the heap
"""
def __init__(self):
self._root = Heap()
def __len__(self):