Skip to content

Instantly share code, notes, and snippets.

View dustinchilson's full-sized avatar

Dustin Chilson dustinchilson

View GitHub Profile
#!/bin/sh
rails $1 #Creates the Rails Project
cd $1 #Changes to the Rails Project Directory
git init #Initializes the git repository
#Creates a git ignore file in the Project root directory to hide your log files
#and other development files
@dustinchilson
dustinchilson / gist:826377
Created February 14, 2011 19:16
multi-level query
SELECT
`Classe`.`id`,
`Classe`.`desc`,
`superClass`.`id`,
`superClass`.`desc`,
`superSuperClass`.`id`,
`superSuperClass`.`desc`
FROM `classes` AS `Classe`
LEFT JOIN `classes` AS `superClass`
ON (`Classe`.`parent_id` = `superClass`.`id`)
@dustinchilson
dustinchilson / gist:826378
Created February 14, 2011 19:16
multi-level query
SELECT
`Classe`.`id`,
`Classe`.`desc`,
`superClass`.`id`,
`superClass`.`desc`,
`superSuperClass`.`id`,
`superSuperClass`.`desc`
FROM `classes` AS `Classe`
LEFT JOIN `classes` AS `superClass`
ON (`Classe`.`parent_id` = `superClass`.`id`)
➔ brew install --HEAD --use-git-head emacs
/usr/local/bin/git
==> Cloning git://repo.or.cz/emacs.git
Updating /Users/dustinchilson/Library/Caches/Homebrew/emacs--git
==> ./configure --prefix=/usr/local/Cellar/emacs/HEAD --without-dbus --enable-locallisppath=/usr/local/share/emacs/site-
==> make
cd lib; make all - --jobserver-fds=5,7 -j \
CC='/usr/bin/gcc-4.2' CFLAGS='-march=core2 -w -pipe -O3' CPPFLAGS='' \
LDFLAGS='' MAKE='make'
cd .. && make am--refresh
@dustinchilson
dustinchilson / emacs
Created April 15, 2011 16:25
emacs Build Failure
➔ brew install -v --use-gcc emacs --cocoa
==> Downloading http://ftp.gnu.org/pub/gnu/emacs/emacs-23.3.tar.bz2
File already downloaded and cached to /Users/dustinchilson/Library/Caches/Homebrew
/usr/bin/tar xf /Users/dustinchilson/Library/Caches/Homebrew/emacs-23.3.tar.bz2
==> Downloading patches
/usr/bin/curl -f#LA Homebrew 0.8 (Ruby 1.8.7-174; Mac OS X 10.6.7) https://github.com/downloads/typester/emacs/feature-fullscreen.patch -o 001-homebrew.diff
######################################################################## 100.0%
==> Patching
/usr/bin/patch -f -p1 -i 001-homebrew.diff
patching file lisp/term/ns-win.el
➔ brew install --HEAD --use-git-head emacs --cocoa
/usr/local/bin/git
==> Cloning git://repo.or.cz/emacs.git
Updating /Users/dustinchilson/Library/Caches/Homebrew/emacs--git
==> ./configure --prefix=/usr/local/Cellar/emacs/HEAD --without-dbus --enable-locallisppath=/usr/local/share/emacs/site-
==> make bootstrap
(cd src; make - --jobserver-fds=5,7 -j bootstrap-clean)
rm -f temacs core *.core \#* *.o libXMenu11.a liblw.a
rm -f ../etc/DOC
rm -f bootstrap-emacs emacs-24.0.50
@dustinchilson
dustinchilson / .rebase.sh and .finishrebase.sh
Created January 19, 2012 19:45 — forked from jmeridth/.rebase.sh and .finishrebase.sh
Modified bash scripts to speed up rebasing for use with git-tfs
# REBASE
#!/bin/bash
if [ $# -eq 1 ]
then
git checkout master && git tfs fetch && git rebase HEAD && git checkout $1 && git rebase -i master
else
echo 'Please provide a feature branch: ./rebase.sh feature1324'
fi
@dustinchilson
dustinchilson / git-tfs-branch.sh
Created September 26, 2012 16:10 — forked from pmiossec/git-tfs-branch.sh
Create a branch with git-tfs
#script to create a branch in git-tfs
if [ $# -ne 3 ] ; then
echo "parameters : ServerUrl Repository localBranch"
echo 'ex : "http://myTfsServer:8080/tfs/Repository" "$/MyProject/MyTFSBranch" "myBranch"'
exit -1
fi
#find TFS first commit of the branch
let first_commit=`tf history $2 | grep "^[0-9]" | awk '{print $1}'`
#Take the parent to have the root commit
@dustinchilson
dustinchilson / gist:4042573
Created November 8, 2012 23:24
ToJson and ToXml
using System.Text;
using System.Web.Script.Serialization;
using System.Xml;
using System.Xml.Serialization;
namespace ObjectExtensions
{
public static class SerializationExtensions
{
public static string ToJson(this object obj)
@dustinchilson
dustinchilson / Clean TFS Branch
Created December 6, 2012 13:47
Cleanup Script for Vault files in TFS
$files = (dir -recurse . | ? { $_.fullname -match "_sgbak" -and $_.PSIsContainer } | % { $_.fullname })
for ($i=0; $i -lt $files.length; $i++)
{
tf undo /recursive $files[$i]
tf delete /recursive $files[$i]
}
$files = (ls -r . | ? {$_.name -match "\b.bak\b" -and !$_.PSIsContainer} | % { $_.fullname })
for ($i=0; $i -lt $files.length; $i++)
{