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
pyxrun() { | |
PYTHON="${PYTHON:-python}" | |
if [ "x$1" = "x-t" ]; then | |
local timeit="time" | |
shift | |
fi | |
if [ -z "$1" ]; then | |
echo "usage: pyxrun [-t] <file>.pyx" |
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
cpdef int fib(int n): | |
if n == 2: | |
return 2 | |
elif n < 0: | |
raise NotImplementedError | |
elif n <= 1: | |
return 1 | |
else: | |
return fib(n-1) + fib(n-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
#!/bin/bash | |
# | |
# aurinfohelper.sh | |
# | |
process() { | |
if [ ! -f PKGBUILD ]; then | |
echo "PKGBUILD not found!" | |
else | |
source PKGBUILD |
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 -*- | |
"""Format announcement of next user group meeting given a template and a data | |
file and open an email client with recipient, subject and body pre-filled. | |
Usage: | |
ankuendigung.py ankuedigung.tmpl meeting.data | |
where ``ankuendigung.tmpl`` is a Jinja2 template and ``meeting.data`` is an |
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":"View","attributes":{"name":"Automation Test","background_color":"RGBA(1.000000,1.000000,1.000000,1.000000)","tint_color":"RGBA(0.000000,0.478000,1.000000,1.000000)","enabled":true,"border_color":"RGBA(0.000000,0.000000,0.000000,1.000000)","flex":""},"frame":"{{0, 0}, {540, 575}}","nodes":[{"class":"View","attributes":{"enabled":true,"flex":"W","name":"view1","corner_radius":5,"border_width":1,"border_color":"RGBA(0.000000,0.000000,0.000000,1.000000)","background_color":"RGBA(0.928571,0.937143,1.000000,1.000000)","uuid":"320B1558-A4C5-4FD7-8DCE-208BAA15B0DC"},"frame":"{{9, 18}, {515, 107}}","nodes":[]},{"class":"Switch","attributes":{"enabled":true,"flex":"","name":"sw_light","value":false,"action":"","border_color":"RGBA(0.000000,0.000000,0.000000,1.000000)","uuid":"AEB0BAA8-F834-46B4-9825-E4D652511996"},"frame":"{{152, 58}, {51, 31}}","nodes":[]},{"class":"Label","attributes":{"font_size":17,"enabled":true,"text":"Licht an\/aus","flex":"","name":"label1","border_color":"RGBA(0.000000,0.000000,0.00 |
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 -*- | |
"""Parse ISO-8601 formatted date/time strings. | |
Uses only standard library modules and supports UTC offsets. | |
""" | |
__all__ = ("parse_isodate", "UTCOffset") | |
import re |
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 -*- | |
"""Convert a string in ASCII hexadecimal notation into a list of integers. | |
Example:: | |
>>> convert_hexstring('F0 7E 7F 06 01 F7') | |
[240, 126, 127, 6, 1, 247] | |
>>> convert_hexstring('f07E7F 6 1 F7') | |
[240, 126, 127, 6, 1, 247] |
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 sound | |
class SoundManager(object): | |
def __init__(self, name = ''): | |
self._playing = dict() | |
def load_effect(self, name): | |
sound.load_effect(name) | |
def play_effect(self, name, volume=0.5, pitch=1.0): |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
--- Functions to wrap love.graphics calls to preserve settings like color, | |
-- line style, filters etc. | |
-- getLineJoin() throws an error if no line join mode is set in love 0.9.1 | |
if not pcall(love.graphics.getLineJoin) then | |
love.graphics.setLineJoin('miter') | |
end | |
-- these are for love 0.9.1 | |
local ALL_SETTINGS = { |
OlderNewer