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
function fixXcode | |
{ | |
pushd > /dev/null | |
cd | |
xcodepath=`xcode-select --print-path`/.. | |
destination=$xcodepath/Frameworks/IDEKit.framework/Versions/A/Resources/SystemCodeSnippets.codesnippets | |
shouldRelaunchXcode=false | |
if [[ `osascript -e 'tell app "System Events" to count processes whose name is "Xcode"'` == 1 ]]; then |
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
# this is useful for lots of git-related functions | |
alias returnIfNotGitRepo='if isGitRepo; then; ; else echo "No repositories here."; return 1; fi' | |
function glastcommit | |
{ | |
returnIfNotGitRepo | |
git show --name-only | |
git show --name-only | pbcopy | |
} |
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
#!/bin/sh | |
# First, a function to safely add custom menu item entries to com.apple.universalaccess.plist, | |
# since duplicate entries in com.apple.custommenu.apps causes a crash when you open | |
# System Preferences and go to Keyboard -> Shortcusts | |
function addCustomMenuEntryIfNeeded | |
{ | |
if [[ $# == 0 || $# > 1 ]]; then | |
echo "usage: addCustomMenuEntryIfNeeded com.company.appname" | |
return 1 |
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
#!/bin/sh | |
function moveAssetImages | |
{ | |
usage="usage: moveAssetImages /path/to/folderOfImages /path/to/Images.xcassets" | |
sourceDir=$1 | |
assetsDir=$2 | |
if [ $# != 2 ]; then |
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
function androidScreenshot | |
{ | |
# only do this if there is a device connected | |
adb shell exit 2>/dev/null | |
if [[ $? == 0 ]]; then | |
# Example filename: ~/Desktop/Android Screen 2013-09-11 12.32.16 PM.png | |
# perl line ending hacks from http://blog.shvetsov.com/2013/02/grab-android-screenshot-to-computer-via.html | |
dateString=`date +"%Y-%m-%d at %I.%M.%S %p"` | |
fileName="Android Screen $dateString.png" | |
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > ~/Desktop/$fileName |
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
function androidScreenshot | |
{ | |
# only do this if there is a device connected | |
adb shell exit 2>/dev/null | |
if [[ $? == 0 ]]; then | |
# Example filename: ~/Desktop/Android Screen 2013-09-11 12.32.16 PM.png | |
# perl line ending hacks from http://blog.shvetsov.com/2013/02/grab-android-screenshot-to-computer-via.html | |
dateString=`date +"%Y-%m-%d at %I.%M.%S %p"` | |
fileName="Android Screen $dateString.png" | |
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > ~/Desktop/$fileName |
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
- (NSString *)stringForTraits:(UIFontDescriptorSymbolicTraits)traits | |
{ | |
NSMutableString *string = [@"traits:" mutableCopy]; | |
if ( traits & UIFontDescriptorTraitItalic ) { [string appendString:@", UIFontDescriptorTraitItalic"];} | |
if ( traits & UIFontDescriptorTraitBold ) { [string appendString:@", UIFontDescriptorTraitBold"];} | |
if ( traits & UIFontDescriptorTraitExpanded ) { [string appendString:@", UIFontDescriptorTraitExpanded"];} | |
if ( traits & UIFontDescriptorTraitCondensed ) { [string appendString:@", UIFontDescriptorTraitCondensed"];} | |
if ( traits & UIFontDescriptorTraitMonoSpace ) { [string appendString:@", UIFontDescriptorTraitMonoSpace"];} | |
if ( traits & UIFontDescriptorTraitVertical ) { [string appendString:@", UIFontDescriptorTraitVertical"];} |
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
osascript -e 'tell application "iOS Simulator" to quit' | |
osascript -e 'tell application "Simulator" to quit' | |
xcrun simctl erase all |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>BackgroundColor</key> | |
<string>#fdf6e4</string> | |
<key>CharColor</key> | |
<string>#6c71c4</string> | |
<key>ClassColor</key> | |
<string>#29a198</string> |
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
function addCustomMenuEntryIfNeeded | |
{ | |
if [[ $# == 0 || $# > 1 ]]; then | |
echo "usage: addCustomMenuEntryIfNeeded com.company.appname" | |
return 1 | |
else | |
local contents=`defaults read com.apple.universalaccess "com.apple.custommenu.apps"` | |
local grepResults=`echo $contents | grep $1` | |
if [[ -z $grepResults ]]; then | |
# does not contain app |
OlderNewer