Skip to content

Instantly share code, notes, and snippets.

Avatar
🔮
Magic

David Corbin davidcorbin

🔮
Magic
View GitHub Profile
@davidcorbin
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
View rob.py
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"
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
davidcorbin / gist:9e5c680f066d5099d717
Created Dec 26, 2014
HitBTC public API using PHP and Curl
View gist:9e5c680f066d5099d717
<?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));
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
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
davidcorbin / .htaccess
Created Apr 7, 2015
Redirect .git directory at the root of a project
View .htaccess
RedirectMatch 404 /\.git
@davidcorbin
davidcorbin / zlib.md
Created Feb 9, 2016
How to fix missing ZLIB_LIBRARY and ZLIB_INCLUDE_DIR cmake error on Windows
View zlib.md

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
davidcorbin / django.sh
Created Apr 6, 2016
Install and test django web server
View django.sh
#!/bin/bash
red='\e[0;31m'
NC='\e[0m'
#Check for root privledges
if [ "$UID" -ne 0 ]
then echo -e "${red}Root privledges required. Type 'su', type enter, then input your password.${NC}"
exit
fi
You can’t perform that action at this time.