Skip to content

Instantly share code, notes, and snippets.

View mcculloughsean's full-sized avatar

Sean McCullough mcculloughsean

  • Groupon
  • San Francisco, CA
View GitHub Profile
@mcculloughsean
mcculloughsean / gist:655553
Created October 30, 2010 17:30
Resque-web stack dump
RuntimeError: -ERR unknown command 'server'
/Users/sean/.rvm/gems/ruby-1.9.2-p0@myapp/gems/redis-2.0.12/lib/redis/client.rb:174:in `format_error_reply'
/Users/sean/.rvm/gems/ruby-1.9.2-p0@myapp/gems/redis-2.0.12/lib/redis/client.rb:164:in `format_reply'
/Users/sean/.rvm/gems/ruby-1.9.2-p0@myapp/gems/redis-2.0.12/lib/redis/client.rb:107:in `read'
/Users/sean/.rvm/gems/ruby-1.9.2-p0@myapp/gems/redis-2.0.12/lib/redis/client.rb:35:in `block in call'
/Users/sean/.rvm/gems/ruby-1.9.2-p0@myapp/gems/redis-2.0.12/lib/redis/client.rb:65:in `block (2 levels) in process'
/Users/sean/.rvm/gems/ruby-1.9.2-p0@myapp/gems/redis-2.0.12/lib/redis/client.rb:247:in `ensure_connected'
/Users/sean/.rvm/gems/ruby-1.9.2-p0@myapp/gems/redis-2.0.12/lib/redis/client.rb:273:in `block in ensure_connected'
/Users/sean/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/sean/.rvm/gems/ruby-1.9.2-p0@myapp/gems/redis-2.0.12/lib/redis/client.rb:269:in `synchronize'
@mcculloughsean
mcculloughsean / city and genre lookup
Created November 3, 2010 20:42
maps the city name and genre to a number
0 -- Boston
1 -- Chicago
2 -- Austin
3 -- Los Angeles
4 -- Nashville
5 -- Toronto
0 -- Show All
1 -- Alternative
2 -- Blues/R&B
@mcculloughsean
mcculloughsean / compile-coffeescript.watchr
Created November 27, 2010 00:57
Compiles coffeescripts to js in the background, preserving directory structure
# Run me with:
# $ watchr compile.watchr
# --------------------------------------------------
# Rules
# --------------------------------------------------
watch( '^Resources/cs/(.*\.coffee)' ) { |m| coffee m }
# --------------------------------------------------
@mcculloughsean
mcculloughsean / Ti Developer Crash
Created December 3, 2010 17:53
Stack dump from Titanium Mobile crash log
Process: Titanium Developer [2444]
Path: /Applications/Titanium Developer.app/Contents/MacOS/Titanium Developer
Identifier: com.appcelerator.titanium.developer
Version: ??? (1.2.1)
Code Type: X86 (Native)
Parent Process: ??? [1]
Date/Time: 2010-12-03 11:52:37.892 -0600
OS Version: Mac OS X 10.6.5 (10H574)
Report Version: 6
Development/titanium/Gordilla[master]% /Library/Application\ Support/Titanium/mobilesdk/osx/1.5.0-dec3/android/builder.py run . ~/android/android-sdk-mac_x86
[INFO] Titanium SDK version: 1.5.0 (12/03/10 10:22 8358de6)
[DEBUG] Waiting for device to be ready ...
[TRACE] adb devices returned 1 devices/emulators
[DEBUG] Device connected... (waited 0 seconds)
[DEBUG] waited 0.085909 seconds on emulator to get ready
[DEBUG] /Users/seanmccullough/android/android-sdk-mac_x86/tools/adb -e shell ls /data/app/com.eliasonmedia.gordilla.apk
[DEBUG] com.eliasonmedia.gordilla installed? False
[DEBUG] /Users/seanmccullough/android/android-sdk-mac_x86/tools/adb -e shell ls /sdcard/Ti.debug/com.eliasonmedia.gordilla/Resources/app.js
[DEBUG] com.eliasonmedia.gordilla resources installed? False
@mcculloughsean
mcculloughsean / Object Inspector.coffee
Created December 4, 2010 17:33
inspects objects in cs
#TODO: fix indentation
Object::inspectMe = (level) ->
obj = this
str = ""
# We start with a non null object
if(obj == null)
return 'Error: Object NULL\n';
lvlindent = ""
lvlindent += ("--" for num in [0..level])
@mcculloughsean
mcculloughsean / Rakefile
Created December 8, 2010 23:36
helpful little rakefile to build android/iphone to simulator, and clean things up
require 'rake'
PLATFORM='osx'
TI_MOBILESDK_PATH= "/Library/Application Support/Titanium/mobilesdk/"
@sdks = Dir.entries(File.join(TI_MOBILESDK_PATH,PLATFORM)) || []
@sdks.delete_if { |s| s =~ /^\./}
DEFAULT_SDK = @sdks.last
APPLICATION_NAME = 'MyApp'
APPLICATION_ID = 'com.MyCompany.MyApp'
DEFAULT_ANDROID_SIMULATOR = ['8', 'WVGA854']
ANDROID_SDK = "!/android/android-sdk-mac_x86"
{
"deals": [{
"placementPriority": "featured",
"mediumImageUrl": "http://www.groupon.com/images/site_images/0311/2710/Ja_-Grill-Restaurant-_-Lounge_profile.jpg",
"highlightsHtml": "<ul>\n<li>Authentic Jamaican fare</li>\n<li>Island cocktails &amp; drinks</li>\n<li>Soothing reggae music</li>\n<li>Lounge with DJs</li>\n</ul>",
"isTipped": true,
"title": "$20 for $40 Worth of Jamaican Cuisine and Island Cocktails at Ja' Grill Restaurant & Lounge",
"startAt": "2010-12-13T06:01:50Z",
"pitchHtml": "<p> stuff </p>",
"division": {
@mcculloughsean
mcculloughsean / stories.rb
Created February 11, 2011 19:27
A fork of the stories.rb from the outside-in sdk examples, to work with ruby 1.9
#!/usr/bin/env ruby
require 'rubygems'
require 'json'
require 'digest/md5'
require 'net/http'
require 'uri'
class StoryFinder
BASE_URL = "http://hyperlocal-api.outside.in/v1.1"
/* I reformatted this because i was having trouble finding the rules i was looking for. The
previous version is layout_old.css if you need to revert. They should be equivalent */
/* color key
fonts:
city-header-blue: #0170b7 - img replaced
link-blue, intro-text-blue: #0072bc
footer-nav-gray, rights-trademarks: #898989
form-text-gray, body-text, dates-times: #a4a4a4 <-- DEFAULT
legal-text-gray: #555