Skip to content

Instantly share code, notes, and snippets.

View michaelsbradleyjr's full-sized avatar
💭
Dip trip, flip fantasia 🎺

Michael Bradley michaelsbradleyjr

💭
Dip trip, flip fantasia 🎺
View GitHub Profile
for i in $HOME/local/*; do
[ -d $i/bin ] && PATH="${i}/bin:${PATH}"
[ -d $i/sbin ] && PATH="${i}/sbin:${PATH}"
[ -d $i/include ] && CPATH="${i}/include:${CPATH}"
[ -d $i/lib ] && LD_LIBRARY_PATH="${i}/lib:${LD_LIBRARY_PATH}"
[ -d $i/lib ] && LD_RUN_PATH="${i}/lib:${LD_RUN_PATH}"
# uncomment the following if you use macintosh
# [ -d $i/lib ] && DYLD_LIBRARY_PATH="${i}/lib:${DYLD_LIBRARY_PATH}"
[ -d $i/lib/pkgconfig ] && PKG_CONFIG_PATH="${i}/lib/pkgconfig:${PKG_CONFIG_PATH}"
[ -d $i/share/man ] && MANPATH="${i}/share/man:${MANPATH}"
@willmot
willmot / wordpress.vcl
Created July 4, 2012 15:48
WordPress Varnish VCL
backend default {
.host = "127.0.0.1";
.port = "8444";
}
sub vcl_recv {
# Allow the back-end to serve up stale content if it is responding slowly.
set req.grace = 2m;
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@carlzulauf
carlzulauf / haversine.sql
Created February 2, 2012 16:47
PostgreSQL function for haversine distance calculation, in miles
-- Haversine Formula based geodistance in miles (constant is diameter of Earth in miles)
-- Based on a similar PostgreSQL function found here: https://gist.github.com/831833
-- Updated to use distance formulas found here: http://www.codecodex.com/wiki/Calculate_distance_between_two_points_on_a_globe
CREATE OR REPLACE FUNCTION public.geodistance(alat double precision, alng double precision, blat double precision, blng double precision)
RETURNS double precision AS
$BODY$
SELECT asin(
sqrt(
sin(radians($3-$1)/2)^2 +
sin(radians($4-$2)/2)^2 *
@hanachin
hanachin / swank-coffee.el
Created December 6, 2011 20:21
eval region, coffee-script
;;; swank-coffee.el hanachin_
;;;
;;; Copyright (c) 2010 Ivan Shvedunov. All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; * Redistributions of source code must retain the above copyright
;;; notice, this list of conditions and the following disclaimer.
@marty-wang
marty-wang / sinon_fake_tick.coffee
Created November 16, 2011 22:55
Use SinonJS to test async functions using process.nextTick
vows = require 'vows'
should = require 'should'
sinon = require 'sinon'
class FakeTicker
constructor: ->
@_originalTick = process.nextTick
sinon
.stub(process, 'nextTick', (callback)->
setTimeout (->
@lancejpollard
lancejpollard / get-set.coffee
Created October 23, 2011 20:08
cross browser getter setters in javascript?
# http://annevankesteren.nl/2009/01/gettters-setters
# http://antimatter15.com/wp/2010/02/experiment-cross-browser-javascript-getters-and-setters/
# http://download.dojotoolkit.org/release-1.3.0/dojo-release-1.3.0/dojox/lang/observable.js
# http://webreflection.blogspot.com/2011/02/btw-getters-setters-for-ie-6-7-and-8.html
# https://gist.github.com/189354
# http://webreflection.blogspot.com/2011/03/rewind-getters-setters-for-all-ie-with.html
# http://code.google.com/p/vbclass/
# http://code.google.com/p/vbclass/source/browse/#svn%2Ftrunk%2Fmin
# https://github.com/eligrey/Xccessors/blob/master/xccessors-legacy.js
# http://jsperf.com/getter-setter
TestWebBundle : {
saveAs : 'test-run-all.js',
contains : [
'node_modules/joose/joose-all.js',
'node_modules/scope-provider/scope-provider-all.js',
'+TestWeb'
]
@autotelicum
autotelicum / samplesFunctional.coffee
Created August 1, 2011 18:43
CoffeeScript samples for Functional from Oliver Steele
# CoffeeScript samples for Functional from Oliver Steele
# -------------------------------------------------------------------
# Documentation: http://osteele.com/sources/javascript/functional/
# Repository: https://github.com/osteele/functional-javascript
# -------------------------------------------------------------------
# Directly import the Functional library since it is not CommonJS enabled