swift todos.swift
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/sh | |
# https://github.com/Homebrew/homebrew-science/issues/4104 | |
brew reinstall opencv3 --HEAD --with-ffmpeg --with-tbb --with-contrib | |
# Since this is keg only, create a pth file to include the python bindings in the python path | |
echo /usr/local/opt/opencv3/lib/python2.7/site-packages >> /usr/local/lib/python2.7/site-packages/opencv3.pth | |
mkdir -p /Users/<user>/Library/Python/2.7/lib/python/site-packages | |
echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/<user>/Library/Python/2.7/lib/python/site-packages/homebrew.pth |
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/bash | |
# J switch uses xz compression | |
XZ_OPT=-9 tar cJf tarfile.tar.xz <directory> |
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/bash | |
# nth-commit.sh | |
# Usage: `nth-commit.sh n [branch]` | |
branch=${2:-'master'} | |
SHA1=$(git rev-list $branch | tail -n $1 | head -n 1) | |
git checkout $SHA1 |
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/bash | |
# update_build_number.sh | |
# Usage: `update_build_number.sh [branch]` | |
# Run this script after the 'Copy Bundle Resources' build phase | |
# Ref: http://tgoode.com/2014/06/05/sensible-way-increment-bundle-version-cfbundleversion-xcode/ | |
branch=${1:-'master'} | |
buildNumber=$(expr $(git rev-list $branch --count) - $(git rev-list HEAD..$branch --count)) | |
echo "Updating build number to $buildNumber using branch '$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
// Create an enum for the tags specified in IB | |
enum TabItems : Int { | |
case FirstTab = 0 | |
case SecondTab | |
case ThirdTab | |
} | |
// Use a switch to handle each item | |
for item in self.tabBar.items { |
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/swift | |
# Take from Apple Sample Code | |
# https://developer.apple.com/library/prerelease/ios/samplecode/AdaptivePhotos/Listings/AdaptiveCode_AdaptiveCode_OverlayView_swift.html | |
class SomeView: UIView { | |
override func intrinsicContentSize() -> CGSize { | |
var size = label.intrinsicContentSize() | |
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
# Use Paramiko or we will get an error on Mavericks | |
ansible-playbook --limit my-desktop site.yml -u <user> --ask-pass --ask-sudo -c paramiko |
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 bash | |
# | |
# Set the build number to the current git commit count. | |
# If we're using the Dev scheme, then we'll suffix the build | |
# number with the current branch name, to make collisions | |
# far less likely across feature branches. | |
# Based on: http://w3facility.info/question/how-do-i-force-xcode-to-rebuild-the-info-plist-file-in-my-project-every-time-i-build-the-project/ | |
# | |
git=`sh /etc/profile; which git` |
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
# | |
# Taken from: | |
# https://github.com/fusionbox/django-authtools | |
# | |
import subprocess | |
version = (0, 2, 0, 'alpha') | |