Skip to content

Instantly share code, notes, and snippets.

View hvirring's full-sized avatar

Jesper Hvirring Henriksen hvirring

  • Copenhagen, Denmark
View GitHub Profile
@hvirring
hvirring / tal.rb
Created November 18, 2012 12:07
Øv tallene 0-99
# Øv tallene 0-99
#
# Kræver System Voice Ida for at tale dansk
# Installér fra System Preferences / Dictation & Speech
def say(phrase)
cmd = `say -v Ida "#{phrase}"`
end
def problem(number = nil)
@hvirring
hvirring / hack.sh
Created May 14, 2012 07:27 — forked from DAddYE/hack.sh
OSX For Hackers
#!/bin/sh
##
# This is a script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# Run in interactive mode with:
# $ sh -c "$(curl -sL https://raw.github.com/gist/2108403/hack.sh)"
#
# or run it without prompt questions:
@hvirring
hvirring / init.rb
Created March 22, 2010 09:23
Patch to make attachment_fu work with S3 EU buckets
# save this as vendor/plugins/attachment_fu_hacks/init.rb
require 'aws/s3'
Technoweenie::AttachmentFu::Backends::S3Backend.module_eval do
# Hacked to use new S3 addressing, which lets us use EU buckets.
# Requires sauberia's fork of aws-3s: http://github.com/sauberia/aws-s3
#
# All public objects are accessible via a GET request to the S3 servers. You can generate a
# url for an object using the s3_url method.
@hvirring
hvirring / home_controller.rb
Created July 17, 2009 12:24
Monitoring Rails POST requests
class HomeController < ApplicationController
skip_before_filter :verify_authenticity_token, :only => :post_up
def index
end
# monitored by http://uptime.alal.com/uptime/
# this will test if Rails is up and responding to GETs and POSTs
def rails_up
url = URI.parse(url_for(:action => 'post_up'))