This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python implementation of the Gibbons-Lester-Bird algorithm[1] for enumerating | |
# the positive rationals. | |
# | |
# James Tauber 2004-07-01 | |
# http://jtauber.com/ | |
# | |
# [1] http://web.comlab.ox.ac.uk/oucl/work/jeremy.gibbons/publications/rationals.pdf | |
def rationals(): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This file is the units database for use with GNU units, a units conversion | |
# program by Adrian Mariano adrian@cam.cornell.edu | |
# | |
# 24 September 2007 Version 1.49 | |
# | |
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006 | |
# 2007 | |
# Free Software Foundation, Inc | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; AutoHotkey script to make CapsLock open URLs and search Google with Clipboard contents. | |
; By Nelson Minar <nelson@monkey.org> Inspired by code at http://www.autohotkey.com/forum/topic14656.html | |
CapsLock:: | |
url := RegExReplace(Clipboard, "^\s+|\s+$") ; Trim whitespace | |
if RegExMatch(url, "^(http|ftp|telnet)") { | |
; Do nothing if it already looks like a URL | |
} else { | |
; Escape the query string. Could escape more, but this seems sufficient for Chrome | |
StringReplace, url, url, `%, `%25, All |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
PIP can stand for PIP Installs packages Programmatically, too! | |
(and here's how) | |
Requires: | |
* Python 2.6 or higher (for print-as-a-function) | |
* PIP 0.8.2 | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyaudio | |
import wave | |
import numpy as np | |
from contextlib import contextmanager | |
import math | |
p = pyaudio.PyAudio() | |
chunk = 1024*4 | |
FORMAT = pyaudio.paInt16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Obsidian] | |
definition-foreground = #678CB1 | |
error-foreground = #FF0000 | |
string-background = #293134 | |
keyword-foreground = #93C763 | |
normal-foreground = #E0E2E4 | |
comment-background = #293134 | |
hit-foreground = #E0E2E4 | |
builtin-background = #293134 | |
stdout-foreground = #678CB1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
# Copyright (C) 2016 Sixten Bergman | |
# License WTFPL | |
# | |
# This program is free software. It comes without any warranty, to the extent | |
# permitted by applicable law. | |
# You can redistribute it and/or modify it under the terms of the Do What The | |
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib | |
matplotlib.use('Agg') | |
from matplotlib import pyplot | |
import numpy | |
from flask import Flask, send_file | |
from cStringIO import StringIO | |
app = Flask(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ಠ_ಠ | |
( ͡° ͜ʖ ͡°) | |
¯\_(ツ)_/¯ | |
(╯°□°)╯︵ ┻━┻ | |
http://www.fileformat.info/convert/text/upside-down.htm | |
WRTTN http://wrttn.me/30dbfd/ | |
Unicode Emoticons |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Disable Google Search rewrite | |
// @version 1.01 | |
// @description Disables the rewrite of links in Google Search results. | |
// @author XP1 (https://github.com/XP1/) | |
// @namespace https://gist.github.com/1780197/ | |
// @include http*://google.*/search?* | |
// @include http*://*.google.*/search?* | |
// ==/UserScript== |
OlderNewer