Skip to content

Instantly share code, notes, and snippets.

View davidcorbin's full-sized avatar
🔮
Magic

David Corbin davidcorbin

🔮
Magic
View GitHub Profile
@davidcorbin
davidcorbin / .htaccess
Created April 7, 2015 16:49
Redirect .git directory at the root of a project
RedirectMatch 404 /\.git
@davidcorbin
davidcorbin / gist:c380d85853d6d55c92cc
Created March 13, 2015 03:09
Find the number of lines of code in a git repository
git ls-files | xargs wc -l
@davidcorbin
davidcorbin / gist:e1440b2037de6d3e024d
Created January 19, 2015 15:56
Autoresize textarea
var observe;
if (window.attachEvent) {
observe = function (element, event, handler) {
element.attachEvent('on'+event, handler);
};
}
else {
observe = function (element, event, handler) {
element.addEventListener(event, handler, false);
};
@davidcorbin
davidcorbin / gist:9e5c680f066d5099d717
Created December 26, 2014 16:58
HitBTC public API using PHP and Curl
<?php
$curl = curl_init("http://api.hitbtc.com/api/1/public/BTCUSD/orderbook");
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
$resultobject = json_decode($result));
Flat UI Colors
#1abc9c - TURQUOISE
#2ecc71 - EMERALD
#3498db - PETER RIVER
#9b59b6 - AMETHYST
#34495e - WET ASPHALT
#16a085 - GREEN SEA
#27ae60 - NEPHRITIS
#2980b9 - BELIZE HOLE
#8e44ad - WISTERIA
@davidcorbin
davidcorbin / rob.py
Created August 5, 2014 20:47
Test if string
thisint = 1
thisstring = "asdf"
if isinstance(thisstring, basestring) :
print thisstring + " is a string"
else:
print thisstring + " is an int"
if isinstance(thisint, basestring) :
print str(thisint) + " is a string"
integerSquareRoot :: Integral a => a -> a
integerSquareRoot n
| n < 0 = error "integerSquareRoot: negative argument"
| otherwise = integerSquareRoot' n
@davidcorbin
davidcorbin / gist:9655809
Created March 20, 2014 02:03
Optimizing For Touch 1
var clicktest = "ontouchstart" in window ? "touchstart" : "click";