Skip to content

Instantly share code, notes, and snippets.

View jawwad's full-sized avatar

Jawwad Ahmad jawwad

View GitHub Profile
@jawwad
jawwad / gist:3151708
Created July 20, 2012 16:33
GG3 Connected Accounts API Design Spec
@interface GGConnectedAccountStore : NSObject
- (GGConnectedAccount *)accountWithType:(GGAccountType)accountType;
@property (nonatomic, strong) NSArray *accounts;
@end
@interface GGConnectedAccount : NSObject
- (id)initWithAccountType:(GGConnectedAccountType)type;
@property (nonatomic, assign) GGConnectedAccountType type;
@property (nonatomic, copy) NSString *username;
@jawwad
jawwad / Kiwi_1.1.1.podspec
Last active December 10, 2015 08:48
A copy of the Kiwi 1.1.1 podspec with $(inherited) removed from FRAMEWORK_SEARCH_PATHS
Pod::Spec.new do |s|
s.name = 'Kiwi'
s.version = '1.1.1'
s.summary = 'A Behavior Driven Development library for iPhone and iPad development.'
s.homepage = 'http://kiwi-lib.info'
s.authors = { 'Allen Ding' => '[email protected]', 'Luke Redpath' => '[email protected]' }
s.license = { :type => 'MIT', :file => 'License.txt' }
s.source = { :git => 'https://github.com/allending/Kiwi.git', :tag => '1.1.1' }
s.source_files = 'Kiwi'
s.framework = 'SenTestingKit'
source 'https://rubygems.org'
gem 'rails', '3.1.0'
gem 'haml'
group :development, :test do
gem 'ruby-debug19'
end
@jawwad
jawwad / databases.rake
Last active August 29, 2015 14:00 — forked from wbailey/databases.rake
Make 'databases.yml' singular to match Rails convention
require 'yaml'
require 'logger'
require 'active_record'
namespace :db do
def create_database config
options = {:charset => 'utf8', :collation => 'utf8_unicode_ci'}
create_db = lambda do |config|
ActiveRecord::Base.establish_connection config.merge('database' => nil)
@jawwad
jawwad / 0_reuse_code.js
Created August 14, 2014 15:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jawwad
jawwad / sourcetree_custom_actions_open_on_github.rb
Created March 25, 2015 03:48
SourceTree Custom Actions to open the selected FILE, SHA, or REPO on github.com
#!/usr/bin/env ruby
## Setup the following Custom Actions in SourceTree preferences in order
## to easily open a FILE or commit SHA in a browser on github.com
# No need to checkmark "Open in Separate Window" or "Show in Full Output"
# Menu Caption: Open SHA on github.com
# Script to run: ~/path/to/this_script.rb
# Parameters: $SHA
import UIKit
class BaseGrid {
init() {
initGrid()
}
// Subclasses override this function
func initGrid() {
println("Superclass")
#!/usr/bin/env ruby
require 'colorize'
PROJECT_NAME = 'provide'
PROJECT_BUILD_COMMAND = "xcodebuild -workspace #{PROJECT_NAME}.xcworkspace -scheme #{PROJECT_NAME} > /dev/null"
ALL_SWIFT_FILES = Dir["#{PROJECT_NAME}/**/*.swift"]
def main
# checks_to_perform = [
@jawwad
jawwad / gist:43002afe74fc74d2e9f5
Created June 24, 2015 13:22
Xcode Build Phase Run script
SCRIPT_LOCATION='/usr/local/bin/swiftlint'
VIOLATIONS_TO_IGNORE="\
Length|\
Force Cast|\
Name Format|\
TODO or FIXME"
if [ -e $SCRIPT_LOCATION ] ; then
$SCRIPT_LOCATION | grep -Ev "($VIOLATIONS_TO_IGNORE) Violation"
import Foundation
let session = NSURLSession.sharedSession()
let requestIsBeingHandledKey = "RequestIsBeingHandledKey"
class CustomNSURLProtocol: NSURLProtocol {
override class func canInitWithRequest(request: NSURLRequest) -> Bool {
if NSURLProtocol.propertyForKey(requestIsBeingHandledKey, inRequest: request) != nil {
return false // Prevent recursize loop