Skip to content

Instantly share code, notes, and snippets.

Stephen Solka trashhalo

Block or report user

Report or block trashhalo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
trashhalo /
Last active Aug 29, 2015 — 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
View gist:32dba18e4b2354706efe
var $private = $injector.has("$private") ? $injector.get("$private") : {};
$private.myprivatfn = function (){};
this.mypublicfn = function () {
View gist:da0e58a1b3bea4d8e9d0
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 Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View gist:9824c8de338af1bdfe6d
function methodThatCleansUpStuff(){
// dont return anything cause you are just cleaning up
function doAsyncStuff() {
return methodThatGivesAPromise()
.then(()=>{throw new Error(“BOOM”)})
View manual-branch.txt
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
View gist:4657814
brew install p7zip
7z x file.7z
trashhalo / remote-package-init.pp
Last active Dec 23, 2015
Puppet custom resource type example
View remote-package-init.pp
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 Dec 23, 2015
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.
View apt-update-init.pp
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"
You can’t perform that action at this time.