Skip to content

Instantly share code, notes, and snippets.

View pennyfx's full-sized avatar

pennyfx

  • LightningFast
  • Truckee, Ca
View GitHub Profile

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 November 1, 2017 21:02
apache bench like tester in node
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',
@pennyfx
pennyfx / docker-snippets.md
Created December 14, 2016 03:42
Docker snippets

Pass git commit to docker image

ARG GIT_COMMIT

ENV GIT_COMMIT ${GIT_COMMIT}
# pass git commit hash to container
['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;
})
@pennyfx
pennyfx / foo.css
Last active August 29, 2015 14:00
::content(h1) {
color: green;
}
@pennyfx
pennyfx / gist:7379441
Created November 8, 2013 23:45
click eventsssssss
var clickTouch = false;
var clickHandler = function(e){
clickTouch = e.touches;
}
document.addEventListener('mousedown', clickHandler);
waitsFor(function(){
return clickTouch !== false;
@pennyfx
pennyfx / gist:7378881
Created November 8, 2013 22:44
touchevent
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);
$(document).ready(function() {
var slidebox = $('x-slidebox')[0];
// go back a slide
document.getElementById('prevButton').addEventListener("click", function(){
slidebox.slidePrevious();
});
// go forward a slide
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 July 25, 2013 20:24
Angular packages in Bower
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