Skip to content

Instantly share code, notes, and snippets.

View mtolly's full-sized avatar

Michael Tolly mtolly

View GitHub Profile
@mtolly
mtolly / imperative.hs
Last active August 29, 2015 14:05
Updated working version of "imperative Haskell" by augustss: http://augustss.blogspot.com/2007/08/programming-in-c-ummm-haskell-heres.html
{-# LANGUAGE Haskell2010, GADTs, Rank2Types, FlexibleInstances #-}
module Main where
import Data.IORef
import Control.Applicative
data X v a where
E :: IO a -> X RValue a
V :: IO a -> (a -> IO ()) -> X v a
@mtolly
mtolly / locals.rb
Created July 31, 2014 00:11
While hunting for bugs in http://opalrb.org/ I discovered this mind-boggling behavior in standard Ruby
def x
2
end
p x # prints 2
x = 1
p x # prints 1
p x() # prints 2
# The above is... annoying, but makes sense. Here's the real WTF though:
@mtolly
mtolly / titlescreen.asm
Created June 2, 2014 20:25
pokered - unknownmusic0xee appears to be the true pan control?
Music_TitleScreen_Ch1::
tempo 0, 144
duty 3
notetype 12, 10, 0
octave 3
note C_, 8
unknownmusic0xee 50 ; to the left
note E_, 8
unknownmusic0xee 237 ; to the right
note G_, 8
@mtolly
mtolly / titlescreen.asm
Last active August 29, 2015 14:02
pokered - testing, what does togglecall do?
Music_TitleScreen_Ch1::
tempo 0, 144
notetype 12, 10, 0
octave 4
note C_, 4
callchannel ASubroutine
note C_, 4
togglecall