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 | |
"""Make the X cursor wrap-around. | |
Adapted from http://appdb.winehq.org/objectManager.php?sClass=version&iId=12599 | |
to work around lack of relative mouse movement http://wiki.winehq.org/Bug6971 | |
for Thief: Dark Shadows (and possibly others) | |
This version is a little kinder to your CPU than the shell script with | |
the busy-loop that starts a new process for every pointer query. | |
""" |
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
:w !sudo tee % |
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
from collections import namedtuple | |
def convert(dictionary): | |
return namedtuple('GenericDict', dictionary.keys())(**dictionary) | |
""" | |
>>> d = dictionary(a=1, b='b', c=[3]) | |
>>> named = convert(d) | |
>>> named.a == d.a | |
True | |
>>> named.b == d.b |
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
(function(window){var i,$sound,$buttonGroup;var $sounds=$(".sound");var clientId=require("config").get("client_id");var oauthToken=require("lib/connect").getAuthToken();var conversionHelper=require("lib/helpers/conversion-helper");var $downloadButton,size;var params,downloadUrl,onSuccess;for(i=$sounds.length-1;i>=0;i--){$sound=$($sounds[i]);var soundcloudUrl="https://soundcloud.com"+($sound.find(".soundTitle__title").attr("href")||window.location.pathname);params={url:soundcloudUrl,client_id:clientId};onSuccess=function($sound){return function(data){var params={client_id:clientId};downloadUrl=require("lib/url").stringify({query:params},data.stream_url+".mp3");$buttonGroup=$($sound.find(".sound__soundActions .sc-button-group")[0]);size=$buttonGroup.find(".sc-button:first")[0].className.match(/sc-button-((?:small)|(?:medium))/)[1];$downloadButton=$('<a class="sc-button sc-button-download sc-button-icon sc-button-responsive">Download</a>').attr({title:"Download this sound ("+conversionHelper.bytesToMB(data.origi |
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
from itertools import izip, product, tee | |
# Logic functions: take and return iterators of truth values | |
def AND(a, b): | |
for p, q in izip(a, b): | |
yield p and q | |
def OR(a, b): | |
for p, q in izip(a, b): |
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/python | |
import sys | |
import time | |
import math | |
import gtk | |
import gobject | |
import pyglet | |
import pyglet.gl as gl |
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
/* Copyright 2012 Dietrich Epp <depp@zdome.net> */ | |
#if defined(__GNUC__) && \ | |
((__GNUC__ == 4 && __GNUC_MINOR >= 6) || __GNUC__ > 4) | |
#define HAVE_DPUSH 1 | |
#endif | |
#include "keycode/keycode.h" | |
#include "keycode/keytable.h" | |
#include "sg/audio_system.h" | |
#include "sg/clock.h" |
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 -*- | |
#Copyright (C) 2013 Seán Hayes | |
import my_project.settings as dj_settings | |
from fabric.api import local, run, sudo, env, prompt, settings, cd, parallel, execute | |
from fabric.contrib.files import exists | |
from fabric.decorators import hosts, roles, runs_once | |
import json | |
import logging | |
import os |
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 logging.config | |
from mediagoblin.app import MediaGoblinApp | |
from beaker.middleware import SessionMiddleware | |
logging.config.fileConfig('paste_local.ini') | |
app = MediaGoblinApp('mediagoblin_local.ini') | |
app = SessionMiddleware(app, { |
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
# vim: tabstop=4 shiftwidth=4 softtabstop=4 | |
#!/usr/bin/python | |
import sys | |
import time | |
import logging | |
from daemon import runner | |
# | |
# An example daemon main logic application class. | |
# Just keep writing timestamps to a log file periodically. | |
# |
OlderNewer