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 sh | |
# Execute this file: | |
# - when logging in | |
# - from a cron job whet the day of time changes (see below) | |
# An improved version could probably get the location from | |
# the internet, and use that to figure out sunrise/sunset times. | |
# Select a random directory. |
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 sys | |
try: | |
rng = xrange | |
except NameError: | |
rng = range # Python 3+ | |
def mesq(base, exp, mod, debug=False): |
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
#define _GNU_SOURCE 1 | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <dlfcn.h> | |
long PP_Initialize(void) { | |
fp = fopen("/dev/stderr", "a"); | |
fprintf(fp, "DEBUG: entering PP_Initialize.\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
-- Hex converter, for RGB colors | |
function hex(inp) | |
return inp > 16 and string.format("%X", inp) or string.format("0%X", inp) | |
end | |
-- Battery monitor | |
mybattmon = widget({ type = "textbox", name = "mybattmon", align = "right" }) | |
function battery_status () | |
local output={} -- output buffer | |
local fd=io.popen("acpitool -b", "r") -- list present batteries |
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
### | |
# Based on: | |
# jQuery JavaScript Library v1.4.2 | |
# http://jquery.com/ | |
# | |
# Copyright 2010, John Resig | |
# Dual licensed under the MIT or GPL Version 2 licenses. | |
# http://jquery.org/license | |
### |
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 csv | |
import random | |
import re | |
import time | |
import urllib2 | |
import urllib3 | |
any_protocol = re.compile('^[^#^\\?^/]+?:') |
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
https://bugs.gentoo.org/show_bug.cgi?id=367425 | |
diff -ruN fontforge-20110222~/fontforge/parsepdf.c fontforge-20110222/fontforge/parsepdf.c | |
--- fontforge-20110222~/fontforge/parsepdf.c 2011-02-15 05:37:39.000000000 +0200 | |
+++ fontforge-20110222/fontforge/parsepdf.c 2011-05-17 22:19:56.000000000 +0300 | |
@@ -759,7 +759,11 @@ | |
if ( zlib!=NULL ) | |
return( true ); | |
- if ( (zlib = dlopen("libz" SO_EXT,RTLD_GLOBAL|RTLD_LAZY))==NULL ) { |
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 | |
class WordFinder(object): | |
"""Searches text for words that conform to the given constraint. | |
To use it, instantiate it with any number of strings. These strings will be | |
used as constraints. For example, to find all words that contain the letter | |
'X' and the number '6', you can do something like this:: |
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 1999-2013 Gentoo Foundation | |
# Distributed under the terms of the GNU General Public License v2 | |
EAPI="4" | |
PYTHON_DEPEND="2" | |
inherit python | |
DESCRIPTION="A set of profiles for the GNU Screen console window manager (app-misc/screen)" | |
HOMEPAGE="https://launchpad.net/byobu" |
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 sh | |
RUBY_VERSION="1.9.1" | |
SERVER="${HOME}/.gem/ruby/${RUBY_VERSION}/bin/camper_van" | |
PIDFILE="/tmp/camper_van.pid" | |
if [ ! -e ${SERVER} ]; then | |
echo "CamperVan server not found at '${SERVER}'." | |
fi |