This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
from email.policy import default | |
import os | |
import pathlib | |
import re | |
import shutil | |
import subprocess | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ~/Library/KeyBindings/DefaultKeyBinding.dict */ | |
// curl -o 'https://gist.githubusercontent.com/jawwad/4461d8a27747b8561bc758b119b1e967/raw' -o ~/Library/KeyBindings/DefaultKeyBinding.dict | |
// wget 'https://gist.githubusercontent.com/jawwad/4461d8a27747b8561bc758b119b1e967/raw' -O ~/Library/KeyBindings/DefaultKeyBinding.dict | |
// quit app for change to take effect | |
{ | |
"~f" = "moveWordForward:"; | |
"~b" = "moveWordBackward:"; | |
"~d" = "deleteWordForward:"; | |
"~F" = "moveWordRightAndModifySelection:"; /* ~$f or $~f doesn't work */ | |
"~B" = "moveWordLeftAndModifySelection:"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class BaseGrid { | |
init() { | |
initGrid() | |
} | |
// Subclasses override this function | |
func initGrid() { | |
println("Superclass") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'rails', '3.1.0' | |
gem 'haml' | |
group :development, :test do | |
gem 'ruby-debug19' | |
end |
NewerOlder