Skip to content

Instantly share code, notes, and snippets.

View davidchase's full-sized avatar
📺
Working from home

David Chase davidchase

📺
Working from home
View GitHub Profile
@davidchase
davidchase / haproxy.cfg
Created August 28, 2014 02:17
haproxy.cfg example based on v1.5.3
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
log 127.0.0.1:514 local2 notice
maxconn 4096
pidfile tmp/haproxy-queue.pid
defaults
log global
mode http
@davidchase
davidchase / format.js
Last active August 29, 2015 14:05
Format Utility
var format = function () {
var args = Array.apply(null, arguments);
var initial = args.shift();
var replacer = function (text, replacement) {
return text.replace('%s', replacement);
}
return args.reduce(replacer, initial);
}
@davidchase
davidchase / hook.sh
Created August 3, 2014 03:56
Before commiting to github run through jshint
#
# Forked from:
# https://raw.githubusercontent.com/goschevski/fronty/master/hooks.sh
#
js_hint='{
"bitwise": false,
"curly": true,
"eqeqeq": true,
"forin": true,
"immed": true,
// Orginal forked from
// https://gist.github.com/localpcguy/1373518
'use strict';
var Swiper = {
config: {
"touchstart": {
"x": -1,
"y": -1
},
@davidchase
davidchase / transitionEnd.js
Created June 16, 2014 18:42
TransitionEnd alternative to Modernizr
// Credits:
// http://stackoverflow.com/questions/5023514/how-do-i-normalize-css3-transition-functions-across-browsers/9090128#9090128
var transitionEndEventName = function() {
var i;
var el = document.createElement('div');
var transitions = {
'transition':'transitionend',
'OTransition':'otransitionend',
'MozTransition':'transitionend',
'WebkitTransition':'webkitTransitionEnd'
for (var i = 1; i <= 100; i++) {
var str = '';
if (i % 3 === 0) str += 'Fizz';
if (i % 5 === 0) str += 'Buzz';
console.log(str || i);
}
// More correct way define str outside of loop
// either way gets hoisted to top of scope in this case
// global environment, in browser the window object
<?php
function lpr($expression) {
$bt = debug_backtrace();
$caller = array_shift($bt);
printf("\n>>> %s:%s > %s\n", $caller['file'], $caller['line'], print_r($expression, true));
}
@davidchase
davidchase / SassMeister-input.scss
Created March 21, 2014 04:20
Generated by SassMeister.com.
// ----
// Sass (v3.3.3)
// Compass (v1.0.0.alpha.18)
// ----
%transition {
-webkit-transition :0.5s ease all;
transition :0.5s ease all;
position :absolute;
left :0;
uptime | awk '{print "Uptime: " $3 " " $4 " " $5 " "$8 " "}';
echo "-----";
ps -amcwwwxo "command %mem %cpu" | grep -v grep | head -19
echo "-----";
@davidchase
davidchase / ie8Support.css
Created July 19, 2013 18:58
IE8 Support with Foundation 4
/* The Grid ---------------------- */
/* line 1453, ../sass/app.scss */
.lt-ie9 .small-1, .lt-ie9 .row .small-1 {
width: 8.33333%;
}
/* line 1454, ../sass/app.scss */
.lt-ie9 .small-2, .lt-ie9 .row .small-2 {
width: 16.66667%;
}