Skip to content

Instantly share code, notes, and snippets.

View incanus's full-sized avatar

Justin R. Miller incanus

View GitHub Profile
@incanus
incanus / Xcode4TestFlightintegration.sh
Created September 1, 2011 19:12
Xcode 4 scheme Archive step Post-script for automatic TestFlight build uploading. See the blog post here: http://developmentseed.org/blog/2011/sep/02/automating-development-uploads-testflight-xcode
#!/bin/bash
#
# (Above line comes out when placing in Xcode scheme)
#
API_TOKEN=<TestFlight API token here>
TEAM_TOKEN=<TestFlight team token here>
SIGNING_IDENTITY="iPhone Distribution: Development Seed"
PROVISIONING_PROFILE="${HOME}/Library/MobileDevice/Provisioning Profiles/MapBox Ad Hoc.mobileprovision"
#LOG="/tmp/testflight.log"
This file has been truncated, but you can view the full file.
$ pod trunk push --allow-warnings --verbose
[!] Found podspec `FMDB.podspec`
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local
because checking is only performed in repo update
Updating spec repo `trunk`
CDN: trunk Relative path: deprecated_podspecs.txt, has ETag?
W/"65c55d2c-b6ad2"
CDN: trunk Relative path not modified: deprecated_podspecs.txt
#!/bin/sh
SRC1=$HOME/Library/Safari
SRC2=$HOME/Library/Containers/com.apple.Safari/Data/Library/Safari
HOST=$( hostname | sed 's/\..*//' )
HOUR=$( date +"%H" )
DST=$HOME/Sync/Safari/$HOST/$HOUR
mkdir -p $DST 2>/dev/null
cd $SRC1
@incanus
incanus / GitTagBundleVersion.sh
Created December 22, 2010 02:23
This is an Xcode build script that will automatically change your app's Info.plist CFBundleVersion string to match the latest git tag for the working copy. If you have commits beyond the last tagged one, it will append a 'd' to the number.
#/bin/sh
INFO=$( echo $PWD )/MyApp-Info
TAG=$( git describe --tags `git rev-list --tags --max-count=1` )
COMMIT=
GITPATH=/usr/bin:/usr/local/bin:/usr/local/git/bin
PATH=$PATH:$GITPATH; export PATH
if [ -z $( which git ) ]; then
echo "Unable to find git binary in \$GITPATH"
@incanus
incanus / safari_backup.sh
Created March 6, 2023 00:12
backup job I run on an hourly cron for some Safari safety
#!/bin/sh
SRC1=$HOME/Library/Safari
SRC2=$HOME/Library/Containers/com.apple.Safari/Data/Library/Safari
HOST=$( hostname | sed 's/\..*//' )
HOUR=$( date +"%H" )
DST=$HOME/Sync/Safari/$HOST/$HOUR
mkdir -p $DST 2>/dev/null
cd $SRC1
@incanus
incanus / gist:1439684
Created December 6, 2011 19:56
Script to export Heroku environment variables to the local shell
#!/bin/sh
for x in `heroku config`; do
if [[ $x == HUBOT* ]]; then
name=$x
elif [ $x != '=>' ]; then
value=$x
export $name=$value
fi
done
const moment = require('moment');
const raw = require('config/raw').raw;
const generatePostFilename = (timestamp, slug) => {
const postDate = moment(timestamp).format('YYYY-MM-DD');
return `content/microposts/${postDate}-${slug}/index.md`;
};
const generatePostUrl = (timestamp, slug) => {
const postDate = moment(timestamp).format('YYYY/MM/DD');
#!/bin/sh
if [ -z "$1" -o -z "$2" -o -z "$3" ]; then
echo "Usage: $0 [movie file] [fps] [delay]"
exit 1
fi
DIR=/tmp/anigif-$( date +"%s" )
mkdir $DIR

Hey folks,

Here are my slides & extra info from my talk last night on Xcode from the command line.

Slides (PDF .zip):

The notification functions that I use in Bash:

INFO=$( echo $TARGET_BUILD_DIR )/$( echo $INFOPLIST_PATH | sed -e 's/\.plist$//' )
echo $INFO
TAG=
COMMIT=
CURRENT=
CURRENT_BUILD=
GITPATH=/usr/bin:/usr/local/bin:/usr/local/git/bin
PATH=$PATH:$GITPATH; export PATH
if [ -z $( which git ) ]; then