Skip to content

Instantly share code, notes, and snippets.

View lf94's full-sized avatar
🏔️
Hey how's it going

49fl lf94

🏔️
Hey how's it going
View GitHub Profile
@lf94
lf94 / brainfuck.hs
Created September 13, 2015 05:11
brainfuck2
{-
A brainfuck interpreter in Haskell.
An exercise to flex these FP muscles.
-}
module Main where
import Debug.Trace
import Control.Monad.Trans.State.Lazy
@lf94
lf94 / anonymous-gist.
Created September 22, 2015 10:49
python what are you doing
>>> dir(1)
['__abs__', '__add__', '__and__', '__bool__', '__ceil__', '__class__', '__delattr__', '__dir__', '__divmod__', '__doc__', '__eq__', '__float__', '__floor__', '__floordi
v__', '__format__', '__ge__', '__getattribute__', '__getnewargs__', '__gt__', '__hash__', '__index__', '__init__', '__int__', '__invert__', '__le__', '__lshift__', '__l
t__', '__mod__', '__mul__', '__ne__', '__neg__', '__new__', '__or__', '__pos__', '__pow__', '__radd__', '__rand__', '__rdivmod__', '__reduce__', '__reduce_ex__', '__rep
r__', '__rfloordiv__', '__rlshift__', '__rmod__', '__rmul__', '__ror__', '__round__', '__rpow__', '__rrshift__', '__rshift__', '__rsub__', '__rtruediv__', '__rxor__', '
__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__truediv__', '__trunc__', '__xor__', 'bit_length', 'conjugate', 'denominator', 'from_bytes', 'im
ag', 'numerator', 'real', 'to_bytes']
@lf94
lf94 / anonymous-gist.
Created October 1, 2015 10:20
Emacs configuration file
(require 'package)
(push '("melpa" . "http://melpa.milkbox.net/packages/")
package-archives)
(package-initialize)
(add-to-list 'load-path "~/.emacs.d/vendor/yagist.el")
(require 'yagist)
(setq circe-use-cycle-completion t)
@lf94
lf94 / HaskMapImproved.hs
Created November 8, 2015 15:30
A naive implementation of a hash map in Haskell - for educational purposes.
{-
A textbook implementation of a hash map using chaining for collisions and
resizing by creating a new map.
-}
import Data.Char
import Data.Hashable
-- | Keep track of how many buckets are filled, and the buckets themselves.
data HashMap a b = MkHashMap Int (ThinHashMap a b)
-- | Remove any information from the HashMap.
@lf94
lf94 / change_intro.py
Created January 16, 2016 17:30
Change Oot:DBG intro
#!/usr/bin/python3
import sys
import os
from struct import *
import mmap
def changeIntroLogo():
emptySpaceAddress = 0x01AA1000 # 0x035CF000
@lf94
lf94 / vtwm.txt
Created September 16, 2016 17:15
vtwm
Hey, this is a long shot, but here goes.
I have this defined in my .vtwmrc configuration file:
Function "map-show" { f.showdesktopdisplay f.warpto "VTWM Desktop" }
Function "iconmgr-show" { f.showiconmgr f.warpto "VTWM Icon Manager" }
called with:
"Space" = control : all : f.function "map-show"
"Space" = shift : all : f.function "iconmgr-show"
@lf94
lf94 / boot.asm
Created September 29, 2016 13:34
Trying to come up with a de-facto way of booting.
INCLUDE "Global.inc"
; Cartridge header
SECTION "Org $00",HOME[$00]
RST_00:
jp $100
SECTION "Org $08",HOME[$08]
RST_08:
@lf94
lf94 / boot.asm
Created October 2, 2016 22:21
Check to see if OAM DMA doesn't write unused bits
INCLUDE "Global.inc"
; Cartridge header
SECTION "Org $00",ROM0[$00]
RST_00:
jp $100
SECTION "Org $08",ROM0[$08]
RST_08:
@lf94
lf94 / partial.asm
Created October 5, 2016 16:05
Beautiful macro
loop:
call WaitVBlank
mUpdateSprite 0, 100, 80, $59, 0, 2, 3
call _HRAM
jp loop
;; Calculate the location of Sprite 1
ld hl, wOAMAddr
ld de, wOAM
ld [hl], d
inc hl
ld [hl], e
mUpdateSprite 80, 40, $59, 0, 2, 3