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
/code _-====-__-======-__-========-_____-============-__ | |
_( coffee _) | |
OO( train )_ | |
0 (_ choo! _) | |
o0 (_ choo! _) | |
o '=-___-===-_____-========-___________-===-dwb-=' | |
.o _________ | |
. ______ ______________ | | _____ | |
_()_||__|| ________ | | |_________| __||___||__ | |
(BNSF 1995| | | | | __Y______00_| |_ _| |
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
#!bash | |
# | |
# bash/zsh completion support for core Git. | |
# | |
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org> | |
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). | |
# Distributed under the GNU General Public License, version 2.0. | |
# | |
# The contained completion routines provide support for completing: | |
# |
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 | |
# Get the current Xcode file | |
filename = `osascript -e 'tell application "Xcode" to set current_document_path to path of last source document'` | |
# Parse the file name | |
name = File.basename(filename) | |
dir = File.dirname filename | |
# Change to the working directory of our repo |
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/ruby | |
unless `git status -s`.strip.empty? | |
puts "Cannot merge-it when your working directory is dirty.\nClean that shit up, bruh" | |
exit | |
end | |
curr_branch = `git branch | grep "*" | sed "s/* //"`.strip | |
system("git checkout master && git merge #{curr_branch} && git branch -d #{curr_branch}") |
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
UIView *view = [[UIView alloc] init]; | |
NSData *objData = [NSData dataWithBytes:(__bridge const void *)(view) length:malloc_size(view)]; | |
NSLog(@"Object contains %@", objData); | |
/* | |
Code via http://mikeash.com/pyblog/friday-qa-2009-03-13-intro-to-the-objective-c-runtime.html | |
Output: | |
Object contains <bc8d7f00 603f6507 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 200000c0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000> |
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
git config --get remote.origin.url | sed 's#^[^:]*.\([^.]*\)\.git#http://github.com/\1#' | xargs open |
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
# Add this script as a build phase in your project. It will update | |
# all embeded framework marketing versions and build version to be | |
# equal to the marketing and build version in your main app. | |
# More details: | |
# https://github.com/Carthage/Carthage/issues/859 | |
# https://forums.developer.apple.com/thread/23778 | |
PLIST_PATH=$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH | |
PLIST_PATH=$(dirname $PLIST_PATH)/$(basename $PLIST_PATH .plist) |
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/ruby | |
def sortProperties(lines) | |
props = Hash.new | |
lines.each {|line| | |
props[line.gsub(/@.+?(\w+?);[^;]*?$/, "\\1")] = line | |
} | |
sortedKeys = props.keys.sort | |
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
+---------------+--------------------------+-------------------------+------------------------+ | |
| | 13" MacBook Air | 15" MacBook Pro | 15" Retina MacBook Pro | | |
| | $2450 | $2790 | $2750 | | |
+===============+==========================+=========================+========================+ | |
| CPU | 2.0 Dual Core i7 $1500 | 2.3 Quad Core i7 $1800 | 2.3 Quad Core i7 $2200 | | |
+---------------+--------------------------+-------------------------+------------------------+ | |
| RAM | 8 GB $100 | 16 GB (OWC) $170 | 16 GB $200 | | |
+---------------+--------------------------+-------------------------+------------------------+ | |
| HD Size/Style | 512 GB SSD $500 | 120 GB SSD (OWC) $140 | 256 GB SSD | | |
| | | 750 GB 7200 RPM $150 | | |
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/ruby | |
# First we save our current branch to a dummy branch | |
# Just in case something goes awry. | |
`git branch -f git-squish-backup` | |
branches = `git branch` | |
curr_branch = /^\*.+/.match(branches)[0] | |
curr_branch.sub!(/^\*./, '') |