Skip to content

Instantly share code, notes, and snippets.

View trashhalo's full-sized avatar
:shipit:

Stephen Solka trashhalo

:shipit:
View GitHub Profile
'use strict';
/**
* @license AngularJS v1.2.0
* (c) 2010-2012 Google, Inc. http://angularjs.org
* License: MIT
*
* TODO(vojta): wrap whole file into closure during build
*/
;(function(){
function f(a){return function(){return this[a]}}function n(a){return function(){return a}}var r;
function s(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if("function"==b&&"undefined"==typeof a.call)return"object";return b}var aa="closure_uid_"+(1E9*Math.random()>>>0),ca=0;function da(a,b){null!=a&&this.append.apply(this,arguments)}da.prototype.ia="";da.prototype.append=function(a,b,c){this.ia+=a;if(null!=b)for(var d=1;d<arguments.length;d++)this.ia+=arguments[d];return this};da.prototype.toString=f("ia");function t(a){
(function() {
var Dancer = {
"start-dance": ["this"],
"stop-dance": ["this"]
};
var DancerImpl = (function() {
var record = function(dancing) {
return this.dancing = dancing;
};
record.prototype.$protocol = Dancer;
@trashhalo
trashhalo / index.html
Last active December 31, 2015 14:29
code playground
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/addon/hint/javascript-hint.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/mode/javascript/javascript.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/addon/edit/matchbrackets.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/addon/display/fullscreen.min.js"></script>
console.log('hi');
@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
@trashhalo
trashhalo / index.js
Created August 31, 2017 12:28
node cache proxy
'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