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
-- Almost Ctr+C Ctrl+V of | |
-- https://bitbucket.org/alquimista/crayon/ | |
-- Author: Alquimista <[email protected]> | |
-- Equation | |
-- http://codeplea.com/simple-interpolation | |
-- http://algorithmist.wordpress.com/ | |
-- Add this module to the includes in NyuFX [http://youka.xobor.de/] |
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
notify-send "$(mpc -f "%artist%" current)" "$(mpc -f "%album%" current)\n$(mpc -f "%title%" current)" |
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
tar cf ~/backups/`date +%Y%m%d%H%M%S`.tar ~/dir |
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 get_pixel_colour(i_x, i_y): | |
import PIL.Image # python-imaging | |
import PIL.ImageStat # python-imaging | |
import Xlib.display # python-xlib | |
o_x_root = Xlib.display.Display().screen().root | |
o_x_image = o_x_root.get_image(i_x, i_y, 1, 1, Xlib.X.ZPixmap, 0xffffffff) | |
o_pil_image_rgb = PIL.Image.fromstring("RGB", (1, 1), o_x_image.data, "raw", "BGRX") | |
lf_colour = PIL.ImageStat.Stat(o_pil_image_rgb).mean | |
return tuple(map(int, lf_colour)) | |
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 | |
# -*- coding: utf-8 -*- | |
import sys | |
import math | |
from PyQt4 import QtGui, QtCore | |
def binomial(i, n): |
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://xiix.wordpress.com/2010/06/23/calculating-opacitys-effect-on-color/ | |
def dark (val, pct): | |
return int(round(val*(1.0-(pct/100.0)))) | |
def light (val, pct): | |
return int(round(val+((255-val)*(pct/100.0)))) | |
def darken (R, G, B, pct): | |
return (dark(R, pct), dark(G, pct), dark(B, pct)) |
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
class MyClass(object): | |
def __init__(self): | |
self._foo = "foo" | |
self._bar = "bar" | |
def foo(): | |
doc = "property foo's doc string" | |
def fget(self): | |
return self._foo | |
def fset(self, value): |
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 | |
#-*- coding:utf-8 -*- | |
from __future__ import division | |
import random | |
import eyecandy | |
from eyecandy.asstags import * | |
FILEINPUT = "(BD) NANA MIZUKI - SILENT BIBLE [ROMAJI1]" |
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 | |
# -*- coding: utf-8 -*- | |
from setuptools import setup, find_packages | |
with open('README.md') as f: | |
readme = f.read() | |
with open('LICENSE') as f: | |
license = f.read() |
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.re | |
post = """--- | |
a:1 | |
b: 2 | |
--- | |
asdf""" | |
RE_POST = re.compile("^---(?P<meta>.*)---(?P<html>.*)$", re.DOTALL) |
OlderNewer