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 reddit to teddit | |
// @namespace https://gist.github.com/bitraid/d1901de54382532a03b9b22a207f0417 | |
// @version 1.0 | |
// @description reddit to teddit | |
// @match *://*.reddit.com/* | |
// @match *://reddit.com/* | |
// @grant none | |
// @run-at document-start | |
// ==/UserScript== |
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
#!/bin/env bash | |
pip3 uninstall pillow | |
apt install \ | |
libjpeg-turbo8-dev \ | |
zlib1g-dev \ | |
libtiff5-dev \ | |
liblcms2-dev \ | |
libfreetype6-dev \ |
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 python3 | |
# -*- coding: utf-8 -*- | |
from PIL import Image, ImageDraw | |
im = Image.open('img_original.png') | |
def interpolate(f_co, t_co, interval): | |
det_co =[(t - f) / interval for f , t in zip(f_co, t_co)] | |
for i in range(interval): |
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
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "Usage: git pr [clean] [<remote>] <id-or-url>" | |
echo "" | |
echo "Examples:" | |
echo "git pr 42 --> git fetch origin pull/42/head:pr/origin/42" | |
echo "git pr upstream 42 --> git fetch upstream pull/42/head:pr/upstream/42" | |
echo "git pr https://github.com/peerigon/phridge/pull/1 --> git fetch https://github.com/peerigon/phridge.git pull/1/head:pr/peerigon/phridge/1" | |
echo "git pr clean --> Deletes all branches that match pr/*/* and pr/*/*/*" |
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
def int_to_tuple(num, base=4): | |
result = ((),) * (num % base) | |
if num >= base: | |
result = (int_to_tuple(num // base, base),) + result | |
return result | |
def tuple_to_int(tup, base=4): | |
if len(tup) == 0: | |
return 0 | |
return tuple_to_int(tup[0], base)*base + tup.count(()) |
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
# -*- coding: utf-8 -*- | |
""" | |
Flask-Login example | |
=================== | |
This is a small application that provides a trivial demonstration of | |
Flask-Login, including remember me functionality. | |
:copyright: (C) 2011 by Matthew Frazier. | |
:license: MIT/X11, see LICENSE for more details. | |
""" |