Skip to content

Instantly share code, notes, and snippets.

Avatar

Tavis Rudd tavisrudd

View GitHub Profile
View index.ts
import * as http from 'http';
import { URL } from 'url';
import { Handler } from 'aws-lambda'
import S3 from 'aws-sdk/clients/s3';
import SSM from 'aws-sdk/clients/ssm';
import SNS from 'aws-sdk/clients/sns';
import ACME from '@root/acme'; // FIX: use a module with types
import CSR from '@root/csr'; // FIX: use a module with types
@tavisrudd
tavisrudd / Witness.hs
Last active Oct 12, 2015
Messing around with type elaboration from ADT -> GADT
View Witness.hs
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ExistentialQuantification #-}
@tavisrudd
tavisrudd / index.js
Last active Aug 29, 2015
vdom messing with widgets
View index.js
var diff = require("virtual-dom").diff
var patch = require("virtual-dom").patch
var h = require("virtual-dom").h
//var _ = require("lodash");
var createElement = require("virtual-dom").create
var OddCounterWidget = function(prefix) {this.prefix = prefix;};
OddCounterWidget.prototype.type = "Widget"
OddCounterWidget.prototype.count = 1
@tavisrudd
tavisrudd / Cheetah_CHANGELOG
Last active Jan 20, 2016
The old CHANGES file from the Cheetah project.
View Cheetah_CHANGELOG
2.0 (Oct 12, 2007)
!!!THIS RELEASE REQUIRES RECOMPILATION OF ALL COMPILED CHEETAH TEMPLATES!!!
- fixed exception handling issue in the C implemenation of NameMapper
[patch from Eric Huss]
- fixed filtering of #included subtemplates
[patch from Brian Bird]
See the release notes from 2.0b1-5 and 2.0rc1-8 for other changes since
View gist:d4f005c9de77a4b2bfd3

CALLING ALL VANCOUVER POLYGLOT UNCONFERENCE VOLUNTEERS!

Would you like to rub shoulders with industry professionals from Microsoft, Hootsuite, Mobify, Plenty of Fish, Clio ... to list a few of our (sold out) conference sponsors? Volunteer for us at our 3rd annual Polyglot conference! For a few hours of your volunteer time, you will be able to attend some of the sessions, and entitle you to get all of the swag that paying attendees would get.

TIME COMMITMENT

May 24, 2014: We are primarily looking for people willing to do registration in the morning (7:30am-12:30pm), plus 1 or 2 people willing to volunteer as photographers for the event throughout the day and help with clean up (4:30-5:30pm), as needed.

@tavisrudd
tavisrudd / Lazy infinite streams in Bash
Last active May 23, 2017
Lazy, infinite recursive sequences in Bash (like in Haskell, if you squint). The result is ugly but interesting.
View Lazy infinite streams in Bash
Lazy, infinite recursive sequences in Bash (like in Haskell, if you squint).
I was inspired by the beautiful Haskell zipWith implementation of the Fibonacci sequence `fibs = 0 : 1 : zipWith (+) fibs (tail fibs)`
to find an equivalent in bash using 'coroutines' and recursive pipes.
My original experiments were https://twitter.com/tavisrudd/status/367164339716751360
"fun w/ recursive pipes: e=echo;mkfifo fib;{ $e 0 1 1 >fib &};{ while read i j k; do $e $i >&2; $e $j $k $(($j+$k));sleep .4; done;}<fib>fib"
and https://twitter.com/tavisrudd/status/367142071489937408
"o=ouro;b=boros;mkfifo $o$b;e=echo; { $e $o > $o$b & }; { while read s;do $e $s>&2;case $s in $o)$e $b;;*)$e $o; esac; done; }<$o$b >$o$b"
@tavisrudd
tavisrudd / alphabet.txt
Created Apr 11, 2013
My dragonfly / natlink alphabet code words. I also have the standard NATO phonetic alphabet enabled (https://en.wikipedia.org/wiki/NATO_phonetic_alphabet).
View alphabet.txt
Aff
Brav Bravo
Cai
Doy Delt Delta
Eck Echo
Fay
Goff
Hoop
Ish
Jo
View browser_repl.clj
;; ## Changes from cljs.repl.browser
;;
;; * Multiple concurrent browser-REPLs can be safely used
;; * The browser-REPL's HTTP server is now always-on
;; * Each browser-REPL session supports a new top-level "entry" URL that
;; can be used to easily start the REPL in a browser or other JS runtime
;; (i.e. you don't need to have a separate webapp running to initiate the
;; browser-REPL connection)
;; * The entry (and REPL) URLs are available in slots on the browser-REPL's
;; environment, making it trivial to automate browser-REPL sessions
@tavisrudd
tavisrudd / links.txt
Created Mar 23, 2013
some links related to my voice coding talk at #pycon
View links.txt
@tavisrudd
tavisrudd / kinesis.txt
Created Mar 2, 2013
A partial list of the Kinesis Advantage / Controllermate / Emacs keybinding tweaks I've done.
View kinesis.txt
Remapped on kinesis itself
--------------------------------------------------------------------------------
caps lock -> backspace (freq use)
backspace -> right gui/windows (freq use)
left alt -> return/enter (very infreq use)
right ctrl -> return/enter (freq use)
right gui/windows -> left gui
enter -> right gui (infreq use)