This file contains hidden or 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
# install alien | |
sudo yum install rpm-build rpmdevtool | |
sudo yum -y localinstall http://sourceforge.net/projects/postinstaller/files/data/alien-8.85-2.noarch.rpm | |
# there's no official libjpeg8 for F17 | |
sudo yum -y localinstall http://download.opensuse.org/distribution/12.2/repo/oss/suse/i586/libjpeg8-8.3.0-12.1.4.i586.rpm | |
# install other requirements | |
sudo yum -y install openssl-static.x86_64 libpng-compat.i686 alsa-plugins-pulseaudio.i686 |
This file contains hidden or 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 | |
from os.path import expanduser | |
from collections import Counter | |
distribution = Counter() | |
f = open(expanduser("~/.bash_history")) | |
commands = list() | |
for line in f.readlines(): | |
line = line.replace("\n","").split(" ") |
This file contains hidden or 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 | |
import time | |
import os.path | |
import atexit | |
import argparse | |
def write_primes(filename, known_primes): | |
"""Writes all known primes from RAM to disk""" |
This file contains hidden or 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 | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
This file contains hidden or 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/python | |
# https://en.wikipedia.org/wiki/Optimal_string_alignment | |
def distance(s, t): | |
"""Calculate Levenshtein distance between words s and t""" | |
m, n = len(s), len(t) | |
d = [[0 for j in range(n)] for i in range(m)] | |
for i in range(1, m): | |
d[i][0] = i |
This file contains hidden or 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 | |
# Uses bpmcount from bpmdj.sf.net to add BPM-tags to your music files. | |
# Copyright (C) 2012 spazzpp2 | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# |
This file contains hidden or 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
<html> | |
<head> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
animate = function(z,t, dt) { | |
$("h1").css( | |
"text-shadow", "rgba(0,0,0,.5) "+17*z+"px "+17*z+"px "+13*z+"pt, rgba(0,0,0,"+.5*(1-z)+") 0 1px 0px, rgba(255,0,0,.5) "+3*z+"pt 1px 3px, rgba(0,255,0,.5) -"+3*z+"pt 1px 3px" | |
).css( | |
"font-size", 19*(2+z)+"pt" |
This file contains hidden or 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
''' | |
===RegexReduce=== | |
Goal is to generate regular expressions out of lists of strings to match | |
all strings in that list. | |
This happens by reducing strings to their unique substrings.. | |
@author: spazzpp2 | |
''' | |
import re |
This file contains hidden or 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 | |
import random as ra | |
import os, time | |
def main(language): | |
ra.seed() | |
ops = ("+", "-", "*", "/") | |
equals = ("=") | |
comma = "point" |
This file contains hidden or 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 | |
""" | |
This script calculates and returns a string of page numbers for | |
printing book-like fold-able printouts. | |
Use it like: | |
python pages.py 42 > pages.file | |
pdftk input.pdf cat `cat pages.file` output output.pdf |