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
View keybase.md

Keybase proof

I hereby claim:

  • I am trashhalo on github.
  • I am trashhalo (https://keybase.io/trashhalo) on keybase.
  • I have a public key ASAiltIMXIBB6Ig-KmeWTQ2FY0VDN2bmGU3AqkBuzpih4Ao

To claim this, I am signing this object:

View listNth.js
(function() {
var jb = ["Out_of_memory", 0],
$a = ["Sys_error", -1],
Q = ["Failure", -2],
$ = ["Invalid_argument", -3],
Ea = ["End_of_file", -4],
Y = ["Division_by_zero", -5],
V = ["Not_found", -6],
Fa = ["Match_failure", -7],
Pa = ["Stack_overflow", -8],
@trashhalo
trashhalo / node
Created Jul 8, 2018
Webassembly Vs Node
View node
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
View ipfs.js
import IPFS from 'ipfs';
import Promise from 'bluebird';
let ipfs;
const settings = {
repo: String(Math.random() + Date.now()),
IpfsDataDir: '/ipfs',
Addresses: {
API: '/ip4/127.0.0.1/tcp/0',
@trashhalo
trashhalo / index.js
Created Aug 31, 2017
node cache proxy
View index.js
'use strict';
require('perish');
var Redis = require('ioredis');
var redis = new Redis();
const http = require('http');
const httpProxy = require('http-proxy');
const streamToPromise = require('stream-to-promise');
const proxy = httpProxy.createProxyServer({
changeOrigin: true
View gist:d6115c1fdaa8873b4659408a4b76014e
# 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
@trashhalo
trashhalo / pivotalSum.js
Last active Oct 24, 2016
Sum the points of checked stories in pivotal
View pivotalSum.js
$(".panel.visible .story").has(".selector.selected").find(".meta span").toArray().reduce(function(e,r){return e+parseInt(r.innerHTML)},0)
View foo.js
.state('G', {
redirectTo: function (trans) {
var svc = trans.injector().get('SomeAsyncService');
var promise = svc.getAsyncRedirectTo(trans.params.foo);
return promise;
}
})
@trashhalo
trashhalo / cancelAJAX.js
Last active Mar 7, 2016 — forked from Integralist/cancelAJAX.js
Try to cancel all jQuery AJAX requests currently running
View cancelAJAX.js
$.xhrPool = [];
$.xhrPool.abortAll = function() {
$.xhrPool.forEach(function(jqXHR) {
jqXHR.abort();
});
};
$.rails.ajax = function(options){
var req = $.ajax(options);
View gist:9824c8de338af1bdfe6d
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)
You can’t perform that action at this time.