This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- | |
A brainfuck interpreter in Haskell. | |
An exercise to flex these FP muscles. | |
-} | |
module Main where | |
import Debug.Trace | |
import Control.Monad.Trans.State.Lazy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- | |
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import sys | |
import os | |
from struct import * | |
import mmap | |
def changeIntroLogo(): | |
emptySpaceAddress = 0x01AA1000 # 0x035CF000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INCLUDE "Global.inc" | |
; Cartridge header | |
SECTION "Org $00",HOME[$00] | |
RST_00: | |
jp $100 | |
SECTION "Org $08",HOME[$08] | |
RST_08: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INCLUDE "Global.inc" | |
; Cartridge header | |
SECTION "Org $00",ROM0[$00] | |
RST_00: | |
jp $100 | |
SECTION "Org $08",ROM0[$08] | |
RST_08: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loop: | |
call WaitVBlank | |
mUpdateSprite 0, 100, 80, $59, 0, 2, 3 | |
call _HRAM | |
jp loop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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 |