Skip to content

Instantly share code, notes, and snippets.

Kevin Smith kvnsmth

Block or report user

Report or block kvnsmth

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
kvnsmth / AppDelegate.swift
Last active Aug 29, 2015
Quick hack to animate launch xib on launch
View AppDelegate.swift
import UIKit
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
var showOverlay = true // whatever you want
View gist:5f36fa44065a8a32a016
### Keybase proof
I hereby claim:
* I am kvnsmth on github.
* I am kvnsmth ( on keybase.
* I have a public key whose fingerprint is C682 85C0 CA4A EDC7 D57E 271C CF79 7B08 1946 98D5
To claim this, I am signing this object:
kvnsmth /
Last active Jan 19, 2020
A real world usage for git subtrees.

Let's say you have an iOS project, and you want to use some external library, like AFNetworking. How do you integrate it?

With submodules

Add the project to your repo:

git submodule add Vendor/AFNetworking

or something to that effect.

kvnsmth / Rakefile
Created Nov 26, 2012
Example Rakefile for distributing through TestFlight
View Rakefile
PROJECT_NAME = "Awesome" # the name of your xcode project
APP_NAME = "Awesome" # whatever your app name is
@configuration = "Release" # xcode project configuration to use
@app_suffix = "-Staging"
SDK_DIR = "/Applications/{SDK_VERSION}.sdk"
BUILD_DIR = File.join(File.dirname(__FILE__), "build")
kvnsmth / get_oauth_access_token.rb
Created Feb 15, 2011
A quick script to get an OAuth access token
View get_oauth_access_token.rb
# run from a command line to get the access token information
require 'rubygems'
require 'oauth'
@consumer_key = "YOUR_CONSUMER_KEY"
@consumer_secret = "YOUR_CONSUMER_SECRET"
@consumer =, @consumer_secret, {
:site => "" # example: ""
kvnsmth / processing_with_carrierwave.rb
Created Oct 15, 2010
Just some code that I threw together to play around with CarrierWave's image manipulation
View processing_with_carrierwave.rb
require 'rubygems'
require 'carrierwave'
require 'fileutils'
# needed for the RMagick module in CarrierWave
def current_path
include CarrierWave::RMagick
kvnsmth / open_browser_on_fail.rb
Created May 12, 2010
Need to debug a failed cucumber scenario? Try this.
View open_browser_on_fail.rb
I chose to put this code in a file under the features/support directory called: open_browser_on_fail.rb. If it's sitting next to the env.rb file itself then you have the new file in the right place.
Place the following code in that file and you'll be good to go!
After do |scenario|
if scenario.status == :failed
View git fails to install with homebrew (rev 70101b34d415edeaba38a54737bb6b6cfa488afe)
/usr/local brew install git
==> Downloading
File already downloaded and cached to /Users/kevinsmith/Library/Caches/Homebrew
==> make prefix=/usr/local/Cellar/git/ install
* new build flags or prefix
GEN git-am
GEN git-bisect
GEN git-difftool--helper
GEN git-filter-branch
View check apple store
require 'rubygems'
require 'growl' #visionmedia-growl
require 'nokogiri'
require 'open-uri'
while true
doc = Nokogiri::HTML(%x[curl -A 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_8; en-us) AppleWebKit/532.0+ (KHTML, like Gecko) Version/4.0.3 Safari/531.9.2009'])
if doc.xpath('//img[@alt="We\'ll be back soon"]').size == 0
Growl.notify {
kvnsmth / gist:119254
Created May 28, 2009
Common states, provinces and countries
View gist:119254
module Configuration
States = {"AA"=>"Armed Forces Americas", "VA"=>"Virginia", "ND"=>"North Dakota", "NY"=>"New York", "AL"=>"Alabama", "RI"=>"Rhode Island", "NE"=>"Nebraska", "MN"=>"Minnesota", "MD"=>"Maryland", "HI"=>"Hawaii", "DE"=>"Delaware", "CO"=>"Colorado", "WY"=>"Wyoming", "PR"=>"Puerto Rico", "MO"=>"Missouri", "ME"=>"Maine", "IA"=>"Iowa", "OR"=>"Oregon", "OH"=>"Ohio", "MP"=>"Northern Mariana Islands", "KY"=>"Kentucky", "IL"=>"Illinois", "GU"=>"Guam", "AZ"=>"Arizona", "AP"=>"Armed Forces Pacific", "AE"=>"Armed Forces Middle East", "TX"=>"Texas", "TN"=>"Tennessee", "NH"=>"New Hampshire", "GA"=>"Georgia", "SC"=>"South Carolina", "MH"=>"Marshall Islands", "IN"=>"Indiana", "ID"=>"Idaho", "SD"=>"South Dakota", "PA"=>"Pennsylvania", "OK"=>"Oklahoma", "NJ"=>"New Jersey", "MS"=>"Mississippi", "MI"=>"Michigan", "FL"=>"Florida", "CT"=>"Connecticut", "AR"=>"Arkansas", "WI"=>"Wisconsin", "PW"=>"Palau", "MT"=>"Montana", "FM"=>"Federated States of Micronesia", "AS"=>"American Samoa", "VI"=>"Virgin Islands", "VT"
You can’t perform that action at this time.