Skip to content

Instantly share code, notes, and snippets.

View trashhalo's full-sized avatar
:shipit:

Stephen Solka trashhalo

:shipit:
View GitHub Profile
console.log('hi');
@trashhalo
trashhalo / git-clean-local.sh
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 () {
$private.myprivatefn();
};
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
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(otherMethodThatGivesAPromise)
.then(()=>{throw new Error(“BOOM”)})
.then(otherOtherMethodThatGivesAPromise)
.catch(methodThatCleansUpStuff)
@trashhalo
trashhalo / cancelAJAX.js
Last active March 7, 2016 03:21 — forked from Integralist/cancelAJAX.js
Try to cancel all jQuery AJAX requests currently running
$.xhrPool = [];
$.xhrPool.abortAll = function() {
$.xhrPool.forEach(function(jqXHR) {
jqXHR.abort();
});
};
$.rails.ajax = function(options){
var req = $.ajax(options);
.state('G', {
redirectTo: function (trans) {
var svc = trans.injector().get('SomeAsyncService');
var promise = svc.getAsyncRedirectTo(trans.params.foo);
return promise;
}
})
@trashhalo
trashhalo / pivotalSum.js
Last active October 24, 2016 18:27
Sum the points of checked stories in pivotal
$(".panel.visible .story").has(".selector.selected").find(".meta span").toArray().reduce(function(e,r){return e+parseInt(r.innerHTML)},0)
@trashhalo
trashhalo / gist:d6115c1fdaa8873b4659408a4b76014e
Created April 3, 2017 13:35
static application development
# Static App Development
## Get the repos
* clone https://github.com/PotomacInnovation/compass-ae
* clone https://github.com/PotomacInnovation/compass-frontend
## Start the server
in compass-ae
* yarn
* yarn start-debug