Skip to content

Instantly share code, notes, and snippets.

@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 / 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
@davidcorbin
davidcorbin / doc.md
Created May 2, 2016
Installing extensions in Vivaldi browser
View doc.md

Installing extensions in Vivaldi browser

In Vivaldi, go to the Chrome Web Store.

Select and install an extension just like you would in Chrome.

Enabling and disabling extensions in Vivaldi

In Vivaldi, go to vivaldi://extensions.