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
#!/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
#!/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
# 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
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 |
NewerOlder