Skip to content

Instantly share code, notes, and snippets.

View trashhalo's full-sized avatar

Stephen Solka trashhalo

View GitHub Profile
trashhalo /
Last active August 29, 2015 13:56 — forked from schacon/gist:942899
Cleans up local tracking branches that dont exist on the remote. Removes all remote branches that have been merged into master.
# clean up merged local branches
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
var $private = $injector.has("$private") ? $injector.get("$private") : {};
$private.myprivatfn = function (){};
this.mypublicfn = function () {
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
trashhalo / 0_reuse_code.js
Last active August 29, 2015 14:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
function methodThatCleansUpStuff(){
// dont return anything cause you are just cleaning up
function doAsyncStuff() {
return methodThatGivesAPromise()
.then(()=>{throw new Error(“BOOM”)})
trashhalo / manual-branch.txt
Created November 5, 2010 18:02
manually add branch
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
#Created a github repository called
git init
git remote add 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
brew install p7zip
7z x file.7z
trashhalo / remote-package-init.pp
Last active December 23, 2015 16:39
Puppet custom resource type example
ensure => 'present'
define remote-package($packagename=$title,$url,$creates){
command=>"/usr/bin/curl -o /tmp/$packagename.deb $url",
trashhalo / apt-update-init.pp
Last active December 23, 2015 16:49
Adds a new apt source to the sources.list.d. Runs apt-get update for only that source and installs a package from the new source.
define apt-update-single($repofile=$title,$source){
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\"",
unless=>"/bin/ls /var/lib/apt/lists/|grep $repofile 2>/dev/null"