Skip to content

Instantly share code, notes, and snippets.

View britg's full-sized avatar
🖖
Building games

Brit Gardner britg

🖖
Building games
View GitHub Profile

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@britg
britg / cap_deploy-quick
Created May 29, 2013 18:23
Sometimes you just want to update from git and restart
namespace :deploy
task :quick do
run "cd #{current_path}; git pull origin #{branch}"
system("cap #{stage} deploy:restart")
end
end
Apps
http://www.reflectionapp.com/
http://flexibits.com/fantastical
http://cheddarapp.com
http://appifywp.com/
http://www.mint.com
https://www.braintreepayments.com/
https://codeclimate.com/
https://cardspring.com/
http://nezumiapp.com/
class Triplet
# Class methods
# these generate Triplet _instances_
def self.up_to max
valid = []
(1..max).each do |x|
y = x+1
z = y+1
@britg
britg / activate.js
Created January 15, 2012 16:47
Bonus strike CSS
$('#bar').removeClass('new').addClass('activated');
class Player < ActiveRecord::Base
# ...
def skills
@skills ||= (Skill.where(:player_id => self.id).first || \
Skill.create(:player_id => self.id))
end
end
@britg
britg / jquery.touch.js
Created January 5, 2012 16:29
jQuery touch events
/**
* touch for jQuery
*
* Copyright (c) 2008 Peter Schmalfeldt (ManifestInteractive.com) <manifestinteractive@gmail.com>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@britg
britg / gist:1341804
Created November 5, 2011 17:33
UA Detect
def current_platform
return @current_platform if defined?(@current_platform)
return 'web' unless user_agent.present?
return (@current_platform = 'iphone') if user_agent.match('iphone')
return (@current_platform = 'android') if user_agent.match('android')
return (@current_platform = 'blackberry') if user_agent.match('blackberry')
if (user_agent.match('windowsphone') || user_agent.match('iemobile'))
return @current_platform = 'windows'
@britg
britg / project.sublime-project
Created October 27, 2011 15:55
SublimeText2 Rails Project Folders
{
"folders":
[
{
"path": "/Users/britg/Projects/ponycorn-fanclub.com",
"folder_exclude_patterns": ["*.sass-cache", "tmp", "log", "assets", "cache"]
}
]
}
@britg
britg / D.json
Created June 18, 2011 01:49
MultistrokeGestureRecognizer-iOS
[
[ [345,9], [345,87] ],
[ [351,8], [363,8], [372, 9], [380, 11], [386, 14], [391, 17], [394, 22], [397, 28], [399,34], [400,42], [400,50], [400,56], [399,61], [397,66], [394,70], [391,74], [386,78], [382,81], [377,83], [372,85], [367,87], [360,87], [355,88], [349,87] ]
]