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 | |
# Count together the CSV rows' last columns and use the first n rows as the key. | |
# Use cut to crop the key space, e.g. | |
# $ cut -d\; -f 3-4,8 | csvsum.py | |
import sys | |
sums = {} |
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/perl -w | |
# | |
# smtpToMaildir.pl (C) 2009 Yrjö Kari-Koskinen <[email protected]> | |
# | |
# This program is licensed under Version 2 of the GPL. | |
# The perl package dependencies can be satisfied with the following | |
# Debian/Ubuntu packages: libmail-box-perl libnet-smtp-server-perl | |
use strict; |
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
# List amount of commits in git repository per month and author | |
git log --pretty='format:%ad %ae' --date=short | sed 's/@.*//'| cut -b -7,11- |sort |uniq -c |awk '{ printf "%s %30s ", $2, $3; count=int($1/2); for(i=0; i<count; i++) { printf "*" } printf "\n"; }' | |
# List amount of commits on different times of day | |
git log --pretty='format:%ad' --date=iso | cut -b 12-13|sort |uniq -c|awk '{ printf "%s %30s ", $2, $3; count=int($1/2); for(i=0; i<count; i++) { printf "*" } printf "\n"; }' | |
# Find inhumane commit times | |
git log --pretty='format:%ad %ae %s' --date=iso | egrep -v "^2012-[0-9-]* ([12]|0[7-9])" |
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
javascript:(function(){$(".board-widgets").hide();$("#board").css("width","98%");})(); |
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 | |
# | |
# transpose.py (C) 2012 Yrjo Kari-Koskinen <[email protected]> | |
# | |
# This program is licensed under Version 2 of the GPL. | |
# | |
# Transpose utf-8 string columns as rows and vice versa | |
# You might need to set PYTHONIOENCODING=utf_8 before calling transpose.py | |
import sys |
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 | |
if [ "$1" == "" ]; then | |
echo Usage: $0 pngfile | |
exit 0; | |
fi | |
FILE=`basename $1 .png` | |
if [ ! -e $FILE.png ]; then |
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
private String getCustomerKeys(List<Customer> customers) { | |
StringBuilder keys = new StringBuilder(); | |
if (customers != null) { | |
for (Customer customer: customers) { | |
if (keys.length() > 0) { | |
keys.append(", "); | |
} | |
keys.append(customer.customerKey.toString()); | |
} | |
return keys.toString(); |
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
% BibTeX bibliography style `label' | |
% Modified from the `alpha' style | |
% Changes: | |
% * New entry labelkey added. If it is present, it will be used as the | |
% label. Otherwise the alpha style label is used. | |
% * The first line of the bibliography will contain only the label. | |
% * The command \textsc will be removed from the beginning of the labelkey | |
% for sorting (see the sortifysc function). | |
% * New entries url and ref added. If url is nonempty it will be typeset |
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 | |
# charFrequency.py (C) 2013 Yrjo Kari-Koskinen <[email protected]> | |
# | |
# This program is licensed under Version 2 of the GPL. | |
# | |
# Use PYTHONIOENCODING=utf_8 environment variable to read and write utf8 to files. | |
import sys, unicodedata | |
def letter(l): |
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 | |
# Select random letters according to the distribution of letters in Finnish language: | |
# https://docs.google.com/spreadsheet/ccc?key=0AiZHeDrg3BuddFZfTXVnclQ5UWNkaGVuWmdVT3dzMEE&usp=sharing | |
# Ignore the uncommon letters c, z, w, q, x and ao | |
import random | |
from itertools import repeat | |
from collections import Counter |
OlderNewer