Skip to content

Instantly share code, notes, and snippets.

Avatar

pennyfx

  • LightningFast
  • Truckee, Ca
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am pennyfx on github.
  • I am pennyfx (https://keybase.io/pennyfx) on keybase.
  • I have a public key ASCbZr13uKlJ5Y4Ii5ypAHB8st_lsuq1_7YGJ4OqCOCq_go

To claim this, I am signing this object:

@pennyfx
pennyfx / gist:a7227e230e74e42ec558455f3d08824e
Last active Nov 1, 2017
apache bench like tester in node
View gist:a7227e230e74e42ec558455f3d08824e
var async = require('async');
var args = require('yargs').argv;
var request = require('request');
String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g, '');};
const concurrency = args.c || 1,
count = args.n || 100,
data = args.d,
verb = args.verb || 'GET',
View docker-snippets.md

Pass git commit to docker image

ARG GIT_COMMIT

ENV GIT_COMMIT ${GIT_COMMIT}
# pass git commit hash to container
@pennyfx
pennyfx / gist:7379441
Created Nov 8, 2013
click eventsssssss
View gist:7379441
var clickTouch = false;
var clickHandler = function(e){
clickTouch = e.touches;
}
document.addEventListener('mousedown', clickHandler);
waitsFor(function(){
return clickTouch !== false;
View gist:7378881
var te = document.createEvent('TouchEvent');
var touch = document.createTouch(window, document, 0,0,0,0,0);
var touchList = document.createTouchList(touch);
te.initTouchEvent('touchstart', true, true, window, {}, false, false, false, false,touchList,touchList,touchList);
te.view = window;
te.altKey = false;
te.ctrlKey = false;
te.shiftKey = false;
te.metaKey = false;
document.dispatchEvent(te);
View gist:6896373
$(document).ready(function() {
var slidebox = $('x-slidebox')[0];
// go back a slide
document.getElementById('prevButton').addEventListener("click", function(){
slidebox.slidePrevious();
});
// go forward a slide
View gist:6503716
x-tooltip:not([orientation=top]):not([orientation=bottom]):not([orientation=left]):not([orientation=right])[_auto-orientation=right] {
x-tooltip[_auto-orientation=top]:not([orientation=top]):not([orientation=bottom]):not([orientation=left]):not([orientation=right]) {
@pennyfx
pennyfx / gist:6083408
Created Jul 25, 2013
Angular packages in Bower
View gist:6083408
angular git://github.com/angular/bower-angular.git
angular-mocks git://github.com/angular/bower-angular-mocks.git
angular-resource git://github.com/angular/bower-angular-resource.git
angular-scenario git://github.com/angular/bower-angular-scenario.git
angular-cookies git://github.com/angular/bower-angular-cookies.git
angular-sanitize git://github.com/angular/bower-angular-sanitize.git
angular-ui git://github.com/angular-ui/angular-ui.git
angular-bootstrap git://github.com/angular-ui/bootstrap-bower.git
angular-unstable git://github.com/johannestroeger/bower-angular-unstable.git
angular-ui-utils git://github.com/angular-ui/ui-utils.git
View gist:6004547
commit 61157b396f2ed781a89e04e43ea044ffb300cc3f
Author: Arron Schaar <aschaar@gmail.com>
Date: Mon Jul 15 12:44:50 2013 -0700
Release 0.7.5
commit 1c1254f35e6803c0b2dd1382015a081a84731e52
Author: Arron Schaar <aschaar@gmail.com>
Date: Mon Jul 15 12:06:52 2013 -0700
View gist:8e5369f4a0b9bc478333
['3','4','3','7'].reduce(function(prev, item){
if(!Array.isArray(prev)){
prev = [prev];
}
if(prev.indexOf(item.toLowerCase())===-1){
prev.push(item.toLowerCase());
}
return prev;
})
You can’t perform that action at this time.