Skip to content

Instantly share code, notes, and snippets.

View bulters's full-sized avatar

Jeroen Bulters bulters

View GitHub Profile
@bulters
bulters / excerpt.hs
Created November 24, 2020 10:58
AoC19 Day 2 optimization attemt
runProgramAt :: Int -> Memory -> Memory
runProgramAt pc m = let opcode = m M.! pc
left = m M.! (m M.! (pc + 1))
right = m M.! (m M.! (pc + 2))
result = m M.! (pc + 3)
next = pc + 4 in
case opcode of
-- 99 signals the end of execution, so just return the memory
99 -> m
-- 1 indicates addition (left + right -> result)

Keybase proof

I hereby claim:

  • I am bulters on github.
  • I am bulters (https://keybase.io/bulters) on keybase.
  • I have a public key ASBlwOZ7n3qt7HBdF3W8nDa8WsI94AYWLC_4aLvsltZSHAo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am bulters on github.
  • I am bulters (https://keybase.io/bulters) on keybase.
  • I have a public key ASCZ4JfQwSlnEmxkET0jA9domBm974BG4zxt8PT94fGTugo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am bulters on github.
  • I am bulters (https://keybase.io/bulters) on keybase.
  • I have a public key whose fingerprint is CD98 1A9D C0DD AF07 7532 8BA7 4BBF 2548 2BB7 7FFB

To claim this, I am signing this object:

@bulters
bulters / MagicAuthenticator.rb
Created January 29, 2014 14:04
My Magic Authenticator implementation framework reference skeleton
class FBAuthenticator
def initialize(uid, token)
@uid = uid
@token = token
end
def authenticate(args)
raise ArgumentError unless args.has_key?(:success)
raise ArgumentError unless args.has_key?(:fail)
@bulters
bulters / .vimrc
Created May 30, 2013 10:15
my vim config per 30-5-2013
" utf-8 only
scriptencoding utf-8
" no vi compat
set nocompatible
function! InstallVundle ()
let iCanHazVundle=1
let vundle_readme=expand('~/.vim/bundle/vundle/README.md')
if !filereadable(vundle_readme)
#!/bin/bash
for USER in `cat .fingers`
do
finger $USER
echo "================================================================================"
done
@bulters
bulters / prooflink_sign_in.rb
Created April 4, 2013 11:28
Sign in at prooflink
@bulters
bulters / util.rb
Created March 19, 2013 16:44
Rubymotion version of scaleAndRotate for iOS
def scaleAndRotateImage(image)
scaleAndRotateImage(image, maxResolution: 640)
end
def scaleAndRotateImage(image, maxResolution: maxResolution)
imgRef = image.CGImage
width, height = CGImageGetWidth(imgRef), CGImageGetHeight(imgRef)
bounds = CGRectMake(0, 0, width, height)
if (width > maxResolution || height > maxResolution)
@bulters
bulters / README.md
Last active December 14, 2015 18:59
Quick Google Geocoding Micro Gem