Public Gists by lukeredpath

Gravatar
Thu Nov 26 06:49:14 -0800 2009
1
2
3
#import "EGOCache.h"
 
@interface EGOCache (Plist)
Gravatar
Wed Nov 18 17:30:20 -0800 2009
1
2
3
# prints to STDOUT by default, optional -o switch to specify output file
$ ruby tweetstream.rb -t 'myhashtag' -f 'lukeredpath' -e 'path/to/template.erb'
 
Gravatar
Thu Nov 12 15:35:59 -0800 2009
1
2
3
# remove unnecessary files and folders
%w{README doc public/favicon.ico}.each { |file| run("rm -rf #{file}") }
 
Gravatar
Wed Nov 04 09:43:22 -0800 2009
1
2
3
#define kApproxRadiusOfEarthInMiles 3963.1676
#define kApproxSizeOfOneDegreeLatitudeInMiles 68.71
#define kApproxSizeOfOneDegreeLongitudeAtLatitude(lat) ((M_PI/180.0)* kApproxRadiusOfEarthInMiles *cos(lat))
Gravatar
Wed Oct 07 03:19:13 -0700 2009
1
2
3
def file_upload_from_string(string, content_type = 'text/plain')
  test_upload_file = nil
  Tempfile.open('file_upload_from_string') do |tempfile|
Gravatar
Wed Sep 16 05:49:59 -0700 2009
1
2
3
# could we track github forks as "sources"?
 
$ brew track [github user]
Gravatar
Mon Sep 14 03:17:45 -0700 2009
1
2
3
#!/usr/bin/env ruby
require 'uri'
 
Gravatar
Wed Sep 02 04:13:46 -0700 2009
1
2
3
#!/bin/sh
export GEM_PATH = /Users/luke/.rvm/gems/ruby/1.8.7:$GEM_PATH
exec "/Users/luke/.rvm/ruby-1.8.7-p174/bin/ruby" "$@"
Gravatar
Tue Sep 01 11:18:26 -0700 2009
1
2
3
#!/usr/bin/env ruby
require 'fileutils'
 
Gravatar
Tue Aug 18 05:16:31 -0700 2009
1
2
3
require "active_record"
 
ActiveRecord::Base.establish_connection(
Gravatar
Mon Jul 20 04:26:43 -0700 2009
1
2
3
require 'observable'
 
class ObservableArray
Gravatar
Wed Jul 08 04:51:00 -0700 2009
1
2
3
# a slightly modified version of multi-parameter attribute support
# extracted from ActiveRecord::Base for use with non-ActiveRecord classes
 
Gravatar
Fri Apr 10 06:16:28 -0700 2009
1
2
3
<!--
Example: monitor a folder for new torrents and move them elsewhere
(e.g. I move them to a network drive that is monitored by
Gravatar
Tue Mar 10 07:50:52 -0700 2009
1
2
3
// ==UserScript==
// Version: 1.0
// @name Co-op OFX Download Link
Gravatar
Sat Mar 07 06:49:47 -0800 2009
1
2
3
#!/usr/bin/env ruby
 
require 'fileutils'
Gravatar
Mon Mar 02 15:03:18 -0800 2009
1
2
3
require 'term/ansicolor'
 
RELEASE_OUTPUT_PATH = File.expand_path("~/Projects/releases/Squeemote")
Gravatar
Sun Mar 01 14:56:10 -0800 2009
1
2
3
RELEASE_OUTPUT_PATH = File.expand_path("~/Projects/releases/Squeemote")
TARGET_NAME = "Squeemote"
CONFIGURATION = ENV['CONFIGURATION'] || "Distribution"
Gravatar
Fri Feb 27 09:37:11 -0800 2009
1
2
3
From b7894c95720d13ec7d955fb3675294db5aedf987 Mon Sep 17 00:00:00 2001
From: Luke Redpath <contact@lukeredpath.co.uk>
Date: Fri, 27 Feb 2009 17:35:41 +0000
Gravatar
Fri Feb 27 09:33:04 -0800 2009
1
2
3
class Tag
  has_many :taggings
end
Gravatar
Thu Feb 26 16:30:28 -0800 2009
1
2
3
class Array
  def move_to_front_of_line(x)
    unshift(delete(self[x]))