Skip to content

Instantly share code, notes, and snippets.

View tippenein's full-sized avatar

Brady Ouren tippenein

  • Los Angeles, CA
  • 00:09 (UTC -07:00)
View GitHub Profile
@eborden
eborden / LossyHistogram.hs
Last active September 8, 2016 17:07
Lossy Histogram On Positive Reals
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module LossyHistogram
( Histogram
, histResolution
, histMagnitude
, histBuckets
, mkHistogram
, fromList
, keys
@tonyday567
tonyday567 / emitter.hs
Last active December 22, 2015 04:48
emitter random walk plus stop/go effect
{-# LANGUAGE RankNTypes #-}
{-# OPTIONS_GHC -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-unused-do-bind -fno-warn-unused-imports -fno-warn-orphans #-}
--
-- Random walk emitter with go and stop button
--
module Main where
import Control.Applicative
@guillaumepiot
guillaumepiot / gist:3939452
Created October 23, 2012 15:28
ANGULARJS - Django CSRF Token header setup
var myApp = angular.module('myApp').config(function($httpProvider) {
$httpProvider.defaults.headers.post['X-CSRFToken'] = $('input[name=csrfmiddlewaretoken]').val();
});
@paulsmith
paulsmith / verbatim_templatetag.py
Created October 25, 2011 19:03 — forked from ericflo/verbatim_templatetag.py
verbatim Django template tag
"""
jQuery templates use constructs like:
{{if condition}} print something{{/if}}
This, of course, completely screws up Django templates,
because Django thinks {{ and }} mean something.
Wrap {% verbatim %} and {% endverbatim %} around those
blocks of jQuery templates and this will try its best