Skip to content

Instantly share code, notes, and snippets.

// Regex to parse "git branch -a -vv"
(\*)? +(.*?) +(.*?)? ((\[(.*?)(: (.*?) (\d+))?\])? ?(.*$))?
// 0 the whole thing
// 1 if there is a * (active)
// 2 branch name
// optional after this
// 3 most recent commit short sha
// 4-5 ignore
Pushing to git@github.com:cbrammer/Saidin.git
To git@github.com:cbrammer/Saidin.git
* [new branch] mergy -> mergy
@cbrammer
cbrammer / .gitconfig
Created January 14, 2012 19:21
Basic Global Git Ignore and Config
[color]
diff = auto
status = auto
branch = auto
[diff]
tool = p4merge
[core]
excludesfile = ~/.gitignore
editor = mate -w
[user]
@cbrammer
cbrammer / gist:1648679
Created January 20, 2012 17:54
Media sample json
{
name: "My File",
user: "userId",
filesTypes: {
"jpg_thumb": "path to s3".
"jpg_full" "path to s3"
},
descriptions: {
"en_US": "my description",
"en_UK": "my UK Dscription"
@cbrammer
cbrammer / gist:1706616
Created January 30, 2012 20:52
Commit Message
## Commit Message Format:
[fixes #<ticket number from pivotal tracker>] Subject
Detailed description
- item one
- item two
rb: Who did the code review for this commit
var http = require('http');
function hitServer(url, port) {
var options = {
host: url,
port: port,
path: '/'
};
http.get(options, function(res) {
@cbrammer
cbrammer / gist:2997391
Created June 26, 2012 17:45
Jenkins fail
Started by user Chase Brammer
Building in workspace /Users/administrator/.jenkins/jobs/ipad-test/workspace
Checkout:workspace / /Users/administrator/.jenkins/jobs/ipad-test/workspace - hudson.remoting.LocalChannel@312d0089
Using strategy: Default
Last Built Revision: Revision cd822e13362346d0a51c2dca068fa3b786222cf4 (origin/test)
Checkout:workspace / /Users/administrator/.jenkins/jobs/ipad-test/workspace - hudson.remoting.LocalChannel@312d0089
Fetching changes from 1 remote Git repository
Fetching upstream changes from git@github.com:ifit/ios.git
Commencing build of Revision 078c36d5c6bb0cec0b748c94280d64340dbf54e4 (origin/test)
Checking out Revision 078c36d5c6bb0cec0b748c94280d64340dbf54e4 (origin/test)
@cbrammer
cbrammer / mergeall
Created September 10, 2012 19:57
Be sure to set as exec (chmod +x)
#!/bin/sh
git checkout $1
git pull origin $1
git checkout $2
git pull origin $2
git merge $1
git push origin $2
git checkout $1
@cbrammer
cbrammer / installer.js
Created October 19, 2012 22:42
NPM Sucks
var npm = require('npm')
, pack = require('./package.json')
, modules = {}
;
if(pack.dependencies) build(pack.dependencies);
if(pack.optionalDependencies) build(pack.optionalDependencies);
if(pack.devDependencies) build(pack.devDependencies);
function build(dependancies) {
@cbrammer
cbrammer / gist:4073486
Created November 14, 2012 17:24
Join program fail
error: TypeError: Object #<Object> has no method 'forEach'
TypeError: Object #<Object> has no method 'forEach'
at Promise.<anonymous> (/opt/node/app/node_modules/payment-api/models/user_payment.js:165:30)
at Promise.addBack (/opt/node/app/node_modules/mongoose/lib/promise.js:128:8)
at Promise.EventEmitter.emit (events.js:96:17)
at Promise.emit (/opt/node/app/node_modules/mongoose/lib/promise.js:66:38)
at Promise.complete (/opt/node/app/node_modules/mongoose/lib/promise.js:77:20)
at Query.findOne (/opt/node/app/node_modules/mongoose/lib/query.js:1533:15)
at Model.Document.init (/opt/node/app/node_modules/mongoose/lib/document.js:229:11)
at Model.init (/opt/node/app/node_modules/mongoose/lib/model.js:192:36)