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 | |
# -*- encoding: utf-8 -*- | |
from sys import stdin, stdout, stderr | |
from optparse import OptionParser | |
from os import urandom | |
from hashlib import sha256 | |
from Crypto.Cipher import AES | |
from base64 import b64encode |
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 datetime import datetime | |
import xml.dom.minidom | |
import re | |
import urllib | |
archive_url = 'http://vikerraadio.err.ee/kuularhiiv?saade=25&kid=123' | |
kid = re.findall('kid=\d+',archive_url)[0].replace('kid=','') | |
rss_base_url = 'http://vikerraadio.err.ee/gfx/rss2.php?id=' | |
rss_url = rss_base_url + kid |
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 | |
# -*- coding: utf-8 -*- | |
from __future__ import division, print_function | |
import os | |
import codecs | |
from sys import argv, hexversion | |
from random import randint | |
from time import sleep |
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 | |
# SNURL_KEY=your-SNURL_KEY-here | |
# SNURL_USER=username | |
if [ "x${SNURL_KEY}" == "x" ] | |
then | |
echo "You need set set sn.im API key, preferably by appending 'export SNURL_KEY=mykey' to .bashrc file. To get one you have to register at sn.im" | |
exit 1 | |
fi |
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 | |
# -*- encoding: utf-8 -*- | |
### Realeased under LGPL-3 | |
### Copyright Andres Erbsen <andres.erbsen@gmail.com> 2011 | |
import urllib2, urllib | |
import time | |
import re | |
import pickle |
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 | |
EXTENSIONSDIR="/usr/lib/firefox-addons/extensions" | |
TMP="/tmp/firefox-extension-install-temp" | |
[ x"$1" == "x" ] || [ ! -f $1 ] && echo "Specify valid .xpi file as argument." && exit 1 | |
sudo rm -rf $TMP 2>/dev/null | |
mkdir -p "$TMP" | |
trap "sudo rm -rf $TMP 2>/dev/null" 1 2 3 15 |
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 random | |
def itershuffle(iterable,bufsize=1000): | |
"""Shuffle an iterator. This works by holding `bufsize` items back | |
and yielding them sometime later. This is NOT 100% random, proved or anything.""" | |
iterable = iter(iterable) | |
buf = [] |
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 functools import wraps | |
try: | |
import cPickle as pickle | |
except: | |
import pickle | |
def cached(fn): | |
cache = {} |
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 os, glob | |
import cPickle as pickle | |
class QueueDir: | |
def __init__(self,dir,pattern='*',statefilename='.queuedir.pc'): | |
self.statefilename = statefilename | |
self.pattern = pattern | |
self.dir = dir | |
self.file_in_progress_mtime = None |
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
#include <stdio.h> | |
#include <string.h> | |
#include <stdbool.h> | |
#include <malloc.h> | |
// input file is named pusle.sis and on the first row there should be | |
// dimensions of the puzzle, then all tiles should follow (separated by whitespace) | |
// Example: | |
// 2 3 | |
// 1 2 3 |
OlderNewer