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
# clean up merged local branches | |
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d |
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
var $private = $injector.has("$private") ? $injector.get("$private") : {}; | |
$private.myprivatfn = function (){}; | |
this.mypublicfn = function () { | |
$private.myprivatefn(); | |
}; |
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
function test_dir { | |
for i in `find $1 -type f|grep _test.rb`; do echo "$(tput bold)> $i$(tput sgr0)" && bundle exec ruby -Itest $i; done | |
} |
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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
function methodThatCleansUpStuff(){ | |
// dont return anything cause you are just cleaning up | |
} | |
function doAsyncStuff() { | |
return methodThatGivesAPromise() | |
.then(otherMethodThatGivesAPromise) | |
.then(()=>{throw new Error(“BOOM”)}) | |
.then(otherOtherMethodThatGivesAPromise) | |
.catch(methodThatCleansUpStuff) |
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
git config --add svn-remote.BRANCHNAME.url https://svn/path_to_newbranch/ | |
git config --add svn-remote.BRANCHNAME.fetch :refs/remotes/BRANCHNAME | |
git svn fetch BRANCHNAME |
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
#Created a github repository called trashhalo.github.com | |
mkdir trashhalo.github.com | |
cd trashhalo.github.com | |
git init | |
git remote add octopress git://github.com/imathis/octopress.git | |
git symbolic-ref HEAD refs/heads/source | |
#Pulling all of octopress into source branch | |
git pull octopress | |
git merge octopress/master | |
git remote add origin git@github.com:trashhalo/trashhalo.github.com.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
brew install p7zip | |
7z x file.7z |
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
package{'curl': | |
ensure => 'present' | |
} | |
define remote-package($packagename=$title,$url,$creates){ | |
exec{"download-$packagename": | |
command=>"/usr/bin/curl -o /tmp/$packagename.deb $url", | |
creates=>$creates, | |
require=>Package['curl'] | |
} |
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
define apt-update-single($repofile=$title,$source){ | |
file{"/etc/apt/sources.list.d/${repofile}.list": | |
ensure=>'present', | |
content=>$source, | |
} | |
exec{"apt-get-update-$repofile": | |
command=>"/usr/bin/apt-get update -o Dir::Etc::sourcelist=\"sources.list.d/${repofile}.list\" -o Dir::Etc::sourceparts=\"-\" -o APT::Get::List-Cleanup=\"0\"", | |
require=>File["/etc/apt/sources.list.d/${repofile}.list"], | |
unless=>"/bin/ls /var/lib/apt/lists/|grep $repofile 2>/dev/null" |
OlderNewer