Skip to content

Instantly share code, notes, and snippets.

View spinosa's full-sized avatar

Dan Spinosa spinosa

View GitHub Profile
@spinosa
spinosa / .gitignore
Last active December 22, 2015 06:38 — forked from adamgit/.gitignore
added support for CocoaPods
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
//show the contact that was tapped on!
}
self.tableView.delegate = yourDelegate;
@spinosa
spinosa / bad_settings.rb
Created May 8, 2012 22:00
Settingslogic at Shelby
module Settings
class Global < Settingslogic
source "#{Rails.root}/config/settings/global.yml"
namespace Rails.env
load!
end
class User < Settingslogic
source "#{Rails.root}/config/settings/user.yml"
@spinosa
spinosa / .ackrc
Created December 28, 2011 21:59
AckMate settings
--type-add=js=.jst
--type-add=css=.scss
--type-add=ruby=.ru
@spinosa
spinosa / .gitconfig
Created December 26, 2011 22:16
colored git output
[color]
ui = always
@spinosa
spinosa / gist:1522194
Created December 26, 2011 22:12
better Git prompt
parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ →\ \1/'
}
export PS1='\u\[\e[1;37m\]:\[\e[1;31m\]\W\[\e[1;33m\]$(parse_git_branch)\[\e[0;39m\]$ '
@spinosa
spinosa / get_broadcasts.rb
Created September 9, 2011 21:05
Using the Shelby API Wapper
require 'shelby_api'
shelbz = Shelby::API.new(
:consumer_key => APP_CONFIG[:shelby_consumer_key], :consumer_secret => APP_CONFIG[:shelby_consumer_secret],
:user_oauth_token => @user.oauth_token, :user_oauth_secret => @user.oauth_secret )
channel_id = shelbz.get_channels()[0]['_id']
broadcasts_10_thru_20 = shelbz.get_broadcasts(channel_id, :limit => 10, :skip => 10)
@spinosa
spinosa / three_legged.rb
Created September 9, 2011 20:34
Get Shelby User's Access Token & Secret
require 'oauth'
require 'json'
# You app needs a gigantic "SIGN IN WITH SHELBY" button. Clicking it should route to this method
def sign_in_with_shelby
# 1. Create a new Shelby app at http://dev.shelby.tv/oauth_clients/new and get your consumer keys from there
consumer = OAuth::Consumer.new( my_apps_consumer_key, my_apps_consumer_secret, {:site=>"http://dev.shelby.tv"})
# 2. We need the request token later to generate an access token, so store that bitch in the session
@spinosa
spinosa / shelby_api.rb
Created September 9, 2011 20:24
Shelby API Wrapper
require 'oauth/signature/plaintext'
require 'json'
module Shelby
class API
extend ActiveSupport::Memoizable
# Create a client to access the Shelby API (via plaintext, two-legged OAuth) for the given user
# requried parameters:
# :consumer_key - your apps consumer key (see http://dev.shelby.tv/myapps)