Skip to content

Instantly share code, notes, and snippets.

View vprtwn's full-sized avatar
🌀
𓊍

Ben Guo vprtwn

🌀
𓊍
View GitHub Profile
protocol ArrayRepresentable {
typealias ArrayType
func toArray() -> ArrayType[]
}
extension Range : ArrayRepresentable {
func toArray() -> T[] {
return T[](self)
}
@johngraham262
johngraham262 / git_search_replace_bash
Last active August 29, 2015 13:56
Git grep is a great search too, but I often find myself wanting to git grep for a term and then *replace* it too. With the "gsr" command, you can type in a search_term and a replace_term and it will search-->replace all matches. It's case-sensitive too.
# gsr = Git Search Replace
gsr() {
search_string=$1
replace_string=$2
if [ -z $search_string ] || [ -z $replace_string ]
then
echo "-- Git Search & Replace (gsr)"
echo "-- usage: gsr search_string replace_string"
else
git grep -l $search_string | xargs sed -i '' "s/$search_string/$replace_string/g"
@DenTelezhkin
DenTelezhkin / README.md
Last active July 11, 2016 09:19
CI Rakefile for iOS applications.Prerequisites: xcpretty, shenzhen, cocoapods, testflight, XCTest.Put this Rakefile into directory with your .xcodeproj and run rake. Remove build tasks you don't need in your setup.

Usage

Install dependencies and run tests

rake 

Dependencies, tests, archive in Release configuration and upload to TestFlight

rake testflight 
@rudyjahchan
rudyjahchan / Rakefile
Created June 9, 2011 16:45
Building and Deploying iOS Projects through Rake
require 'yaml'
require 'uri'
require 'tempfile'
require 'tmpdir'
SDK_DIR = "/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk"
TESTFLIGHT_URL = 'http://testflightapp.com/api/builds.json'
PROJECT_DIR = File.dirname __FILE__
RUBIOS_DIR = File.join(PROJECT_DIR, 'rubios')