Skip to content

Instantly share code, notes, and snippets.

View alexb5dh's full-sized avatar
☄️
Creating things

Alex alexb5dh

☄️
Creating things
View GitHub Profile
@alexb5dh
alexb5dh / binomial.py
Created March 28, 2017 16:19 — forked from rougier/binomial.py
A fast way to calculate binomial coefficients in python (Andrew Dalke)
def binomial(n, k):
"""
A fast way to calculate binomial coefficients by Andrew Dalke.
See http://stackoverflow.com/questions/3025162/statistics-combinations-in-python
"""
if 0 <= k <= n:
ntok = 1
ktok = 1
for t in xrange(1, min(k, n - k) + 1):
ntok *= n
@alexb5dh
alexb5dh / google-translate-tooltip.user.js
Last active March 16, 2017 20:04 — forked from steelywing/google-translate-tooltip.user.js
google translate tooltip for firefox & chrome
// ==UserScript==
// @name Google Translate Tooltip
// @namespace steely.wing
// @version 1.10
// @description Translates selected text into a tooltip.
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @copyright 2014, Wing Leong (http://steelywing.iblogger.org/)
// @include *
// @require http://code.jquery.com/jquery-2.1.0.min.js
// @grant GM_getValue
@alexb5dh
alexb5dh / .gitconfig
Last active June 13, 2016 20:47 — forked from shawndumas/.gitconfig
Using WinMerge as the git Diff/Merge Tool on Windows 64bit
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = false
[merge]
tool = winmerge
[mergetool "winmerge"]
name = WinMerge
@alexb5dh
alexb5dh / uri.js
Last active May 22, 2016 21:41 — forked from jlong/uri.js
Simple uri parsing in raw browser js.
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"