Skip to content

Instantly share code, notes, and snippets.

View bulters's full-sized avatar

Jeroen Bulters bulters

View GitHub Profile
@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)

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:

named_scope :magic, lambda {
{
:joins => "INNER JOIN airings ON airings.id=spotlights.object_id INNER JOIN episodes ON episodes.id=airings.episode_id",
:conditions => ["object_type='Airing' AND airings.ends_at < ? AND episodes.video IS NOT NULL", DateTime.now.utc],
:order => "airings.ends_at DESC",
:group => "airings.id"
}
}
@bulters
bulters / Git Unstage file
Created June 30, 2010 09:07
Git alias for 'unstaging' changes
git config --global alias.unstage='reset HEAD --'
@bulters
bulters / LICENSE.txt
Created May 27, 2011 12:00 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@bulters
bulters / README.md
Last active December 14, 2015 18:59
Quick Google Geocoding Micro Gem
@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)
#!/bin/bash
for USER in `cat .fingers`
do
finger $USER
echo "================================================================================"
done
@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)

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: