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
function upload_img($id = null)
{
$this->layout = 'empty';
//Configure::write('debug', 0);
if(empty($this->data)) {
die();
}
$full = $this->JqImgcrop->uploadImage($this->data['Listing']['image'], 'img/listings/full/', time());
@britg
britg / gist:244160
Created November 27, 2009 18:36 — forked from bscofield/gist:181842
# mongo_template.rb
# remove unneeded defaults
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/javascripts/controls.js"
run "rm public/javascripts/dragdrop.js"
run "rm public/javascripts/effects.js"
run "rm public/javascripts/prototype.js"
[52/70] cxx: src/node.cc -> build/default/src/node_6.o
../src/node.cc: In function ‘void node::CheckIdleness(ev_timer*, int)’:
../src/node.cc:135: error: no matching function for call to ‘v8::V8::IdleNotification()’
default/deps/v8/include/v8.h:2331: note: candidates are: static bool v8::V8::IdleNotification(bool)
../src/node.cc: In function ‘void node::NotifyIdleness(ev_idle*, int)’:
../src/node.cc:149: error: no matching function for call to ‘v8::V8::IdleNotification()’
default/deps/v8/include/v8.h:2331: note: candidates are: static bool v8::V8::IdleNotification(bool)
../src/node.cc: In function ‘ssize_t node::DecodeWrite(char*, size_t, v8::Handle<v8::Value>, node::encoding)’:
../src/node.cc:376: error: ‘HINT_MANY_WRITES_EXPECTED’ is not a member of ‘v8::String’
../src/node.cc:381: error: ‘HINT_MANY_WRITES_EXPECTED’ is not a member of ‘v8::String’
@britg
britg / Procfile
Created June 3, 2011 03:02
My Procfile
web: bundle exec thin start
worker: bundle exec rake jobs:work
log: tail -f -n 0 log/development.log
watchr: bundle exec rake watchr
@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] ]
]
@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 / 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 / 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,
class Player < ActiveRecord::Base
# ...
def skills
@skills ||= (Skill.where(:player_id => self.id).first || \
Skill.create(:player_id => self.id))
end
end
@britg
britg / activate.js
Created January 15, 2012 16:47
Bonus strike CSS
$('#bar').removeClass('new').addClass('activated');