Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View BennettSmith's full-sized avatar
💭
Always learning!

Bennett Smith BennettSmith

💭
Always learning!
  • San Francisco Bay Area, CA
  • 02:29 (UTC -07:00)
View GitHub Profile
@BennettSmith
BennettSmith / gist:876359
Created March 18, 2011 16:23
Insert in .bashrc to display RVM gemset and git branch in shell prompt.
function parse_git_branch () {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[1;34m\]"
NO_COLOUR="\[\033[0m\]"
@BennettSmith
BennettSmith / gist:876607
Created March 18, 2011 18:43
Git Usage Notes

Generating SSH Key: - ssh-keygen -t rsa -C "account@host.com" - (save in a file like id_rsa-github) - ssh-add ~/.ssh/id_rsa-github Configuration: - git config --global user.name "Bennett Smith" - git config --global user.email "bsmith@idevelopsoftware.com" - git config --global github.user idvlpsw - git config --global github.token e0e9e3498b7b2780b33eece4a46fb674 - git config --global --list

@BennettSmith
BennettSmith / gist:877892
Created March 19, 2011 23:09
Save dSYM files for iOS projects.
STORAGEDIR=~/Development/dSYMStorage/
BUILDDATE=`date +%Y%m%d`
cd ${BUILT_PRODUCTS_DIR}
tar -czf ${STORAGEDIR}/${PRODUCT_NAME}-${BUILDDATE}.tbz ${PRODUCT_NAME}.app ${PRODUCT_NAME}.app.dSYM
@BennettSmith
BennettSmith / com.apple.syslogd.plist
Created August 9, 2011 14:37
Updated com.apple.syslogd.plist with network listener support added.
<?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>EnableTransactions</key>
<true/>
<key>EnvironmentVariables</key>
<dict>
<key>ASL_DISABLE</key>
<string>1</string>
@BennettSmith
BennettSmith / .gitignore
Created December 10, 2011 15:08
Create a 1Hut Linux Template on Parallels
.DS_Store
*.iso
@BennettSmith
BennettSmith / NSObject+DumpClassInfo.h
Created January 14, 2012 22:27
Objective-C class category to print out names of all selectors on a class.
//
// NSObject+DumpClassInfo.h
// DumpSelectors
//
// Created by Bennett Smith on 1/14/12.
// Copyright (c) 2012 iDevelopSoftware, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
@BennettSmith
BennettSmith / xcode4_build.py
Created March 25, 2012 03:04 — forked from dsibilly/xcode4_build.py
Unique Build Numbers for XCode 4
# XCode 4 auto-versioning script for Git
# Inspired by the work of Axel Andersson, Marcus S. Zarra and Matt Long
# http://valthonis.net/u/19
"""
NOTE: Due to its use of build environment variables, this
script will only work from inside XCode's build process!
"""
import os
@BennettSmith
BennettSmith / api.py
Created April 11, 2012 21:59
Tastypie Experiment
# myapp/api.py
from tastypie.authorization import Authorization
from tastypie.authentication import ApiKeyAuthentication
from django.core.urlresolvers import NoReverseMatch
from django.conf.urls.defaults import url
from django.http import HttpRequest
from tastypie.utils import trailing_slash
from django.contrib.auth.models import User
#!/bin/bash
# Create the script that emits values for a single file using stat.
cat >/tmp/fileperms.sh <<FILEPERMS
#!/bin/bash
echo chmod `stat -f '%Lp' \$1` \"\$1\"
echo chown `stat -f '%u' \$1`:`stat -f '%g' \$1` \"\$1\"
FILEPERMS
# Make sure the script is executable
@BennettSmith
BennettSmith / .gitignore
Created April 17, 2013 22:39
The .gitignore file I use with Xcode projects.
# Xcode
build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3