Skip to content

Instantly share code, notes, and snippets.

View rampion's full-sized avatar

Noah Luck Easterly rampion

  • Mercury Technologies
View GitHub Profile
// !debit [field] [action] decrements [field] and runs [action] if [field] > 0
//
// examples (note the '\' to prevent the &{...} from running immediately)
//
// !debit classactionresource1 %\{Coll|classaction1}
//
// !debit repeating_classresources_-KBB1UHdMK0ygfFM3AtV_ClassResourceTotal %\{Coll|classaction2}
//
// (I don't know a better way to get repeating classaction ids than inspecting the page)
var DebitModule = DebitModule || (function(){ "use strict";
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DataKinds #-}
module Temp where
data A = A1 | A2
data B = B1 | B2
data C (a :: A) (b :: B)where
require 'set'
def ContextFreeGrammar(&blk)
ContextFreeGrammar.new(&blk)
end
class ContextFreeGrammar
attr_reader :rules
def initialize(&blk)
@rules = instance_eval(&blk)
" adapted from https://github.com/aaronjensen/vimfiles/blob/2a88ef0b92f5a628e898189e612eb0feb34b1419/vimrc#L449-483
" save as ~/.vim/plugin/bracketed_paste.vim to use
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Tmux wrapping borrowed from vitality.vim: https://github.com/sjl/vitality.vim
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function WrapForTmux(s)
if !exists('$TMUX')
return a:s
endif
@rampion
rampion / .gitignore
Last active August 29, 2015 14:18
Implentation of Extended Euclidean Algorithm
dist
*.hi
*.o
{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE RankNTypes #-}
module Temp where
type Point f = forall a. a -> f a
data Nat = Z | S Nat
@rampion
rampion / Makefile
Last active August 29, 2015 14:13
for some reason, I was tempted to play with dependency injection in C
fizzbuzz: depinjex.c main.c
gcc -o $@ $^
fizzbuzz-test: depinjex.c test.c
gcc -DENABLE_DEPENDENCY_INJECTION -o $@ $^
test: fizzbuzz-test
./$^
clean:
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
module Cascade where
import Control.Category
import Control.Comonad
<!doctype html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
</head>
<body>
</body>
</html>