Skip to content

Instantly share code, notes, and snippets.

davidcorbin / gist:9655809
Created Mar 20, 2014
Optimizing For Touch 1
View gist:9655809
var clicktest = "ontouchstart" in window ? "touchstart" : "click";
View gist:8438b681a60bd61e916d
integerSquareRoot :: Integral a => a -> a
integerSquareRoot n
| n < 0 = error "integerSquareRoot: negative argument"
| otherwise = integerSquareRoot' n
thisint = 1
thisstring = "asdf"
if isinstance(thisstring, basestring) :
print thisstring + " is a string"
print thisstring + " is an int"
if isinstance(thisint, basestring) :
print str(thisint) + " is a string"
View gist:f2af3335c7900dd81aa8
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 / gist:9e5c680f066d5099d717
Created Dec 26, 2014
HitBTC public API using PHP and Curl
View gist:9e5c680f066d5099d717
$curl = curl_init("");
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
$resultobject = json_decode($result));
View gist:e1440b2037de6d3e024d
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 / gist:c380d85853d6d55c92cc
Created Mar 13, 2015
Find the number of lines of code in a git repository
View gist:c380d85853d6d55c92cc
git ls-files | xargs wc -l
davidcorbin / .htaccess
Created Apr 7, 2015
Redirect .git directory at the root of a project
View .htaccess
RedirectMatch 404 /\.git
davidcorbin /
Created Feb 9, 2016
How to fix missing ZLIB_LIBRARY and ZLIB_INCLUDE_DIR cmake error on Windows

How to fix missing ZLIB_LIBRARY and ZLIB_INCLUDE_DIR cmake error on Windows

Install ZLIB

Download ZLIB for Windows from Sourceforge and install it on your Windows machine. Works with x86/x64

Find ZLIB install directory

Currently, the ZLIB installer from Sourceforge (above) installs in C:/Program Files (x86)/GnuWin32.

davidcorbin /
Created Apr 6, 2016
Install and test django web server
#Check for root privledges
if [ "$UID" -ne 0 ]
then echo -e "${red}Root privledges required. Type 'su', type enter, then input your password.${NC}"