Skip to content

Instantly share code, notes, and snippets.

View unhammer's full-sized avatar
kevin :: Coffee → Code

Kevin Brubeck Unhammer unhammer

kevin :: Coffee → Code
View GitHub Profile
@unhammer
unhammer / pylibtextcat.arch.patch
Created December 16, 2010 14:52
patch to make pylibtextcat run on Arch Linux
diff -rupN original/pylibtextcat-0.1//libtextcat.c pylibtextcat-0.1//libtextcat.c
--- original/pylibtextcat-0.1//libtextcat.c 2008-06-18 01:26:04.000000000 +0200
+++ pylibtextcat-0.1//libtextcat.c 2010-12-16 15:35:27.560001525 +0100
@@ -1,4 +1,4 @@
-#include <libtextcat/textcat.h>
+#include <textcat.h>
#include "libtextcat.h"
static const char __author__[] =
@@ -32,7 +32,7 @@ libTextCat_init(libTextCatObject *self,
@jimregan
jimregan / irish.sbl
Created March 15, 2012 20:55
Irish stemmer
routines (
R1 R2 RV
initial_morph
mark_regions
noun_sfx
deriv
verb_sfx
)
externals ( stem )
@jimregan
jimregan / apertium-cleanstream.cc
Created April 2, 2012 12:21
Simple file to clean an Apertium stream.
/*
* Copyright (C) 2005 Universitat d'Alacant / Universidad de Alicante
*
* 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
@unhammer
unhammer / to-utf.sh
Created April 20, 2012 10:30
turn an unholy jumble of iso-SOMETHING and UTF-8 into UTF-8
#!/bin/bash
decodehtmlentities='#!/usr/bin/env python2
import sys, codecs
sys.stdin = codecs.getreader("utf-8")(sys.stdin)
sys.stdout = codecs.getwriter("utf-8")(sys.stdout)
sys.stderr = codecs.getwriter("utf-8")(sys.stderr)
import HTMLParser
h = HTMLParser.HTMLParser()
anonymous
anonymous / stdin.sh
Created May 29, 2012 20:31
stdin
#!/bin/bash
set -f # no globbing, so we can safely use *
# other_local[joe]=:0, other_local[bob]=:1 etc. for all active local
# users other than us:
unset other_local; declare -A other_local;
while read -rd $'\t'; do
IFS=$',\n' r=($REPLY)
[[ "${#r[@]}" -ge 4 && "${r[4]}" != '*' && "${r[2]}" != '' && "${r[0]}" != '' ]] && other_local[${r[2]}]=${r[0]}
@unhammer
unhammer / README.md
Created October 1, 2012 13:29 — forked from mbostock/.block
pan on drag with d3

pan using zoom behaviour, unfortunately not very smooth

@unhammer
unhammer / popoutvideo.js
Last active December 14, 2015 07:08
maybe I just have to make a userstyle instead :/
// ==UserScript==
// @name Lesschrome popup of HTML5 video
// @description Lesschrome popup window of the current url; ensure you uncheck "Always show the tab bar" in Firefox tab settings
// @include *
// @version 1
// @grant none
// ==/UserScript==
function obj_to_settingsstr (obj) {
var settingsstr = "";
@unhammer
unhammer / mindiff
Last active December 18, 2015 04:49
call diff on two files, but ignore lines after the length of the shortest one
#!/bin/bash
if [[ $# -lt 2 ]]; then
echo "Usage: $0 file1 file2 [additional options to diff]"
exit 1
fi
if1=$1
if2=$2
shift 2
@wmerrifield
wmerrifield / build+archive.sh
Created November 8, 2010 17:53
A shell script to perform the equivalent of Xcode's "Build & Archive" command.
#!/bin/sh
#
# Copyright (c) 2010 Warren Merrifield
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@kosmikus
kosmikus / Tutorial.hs
Last active May 1, 2020 23:59
Preliminary rewrite of Gabriel's lens tutorial to use `optics` instead of `lens`
{-| This @lens@ tutorial targets Haskell beginners and assumes only basic
familiarity with Haskell. By the end of this tutorial you should:
* understand what problems the @lens@ library solves,
* know when it is appropriate to use the @lens@ library,
* be proficient in the most common @lens@ idioms,
* understand the drawbacks of using lenses, and: