Skip to content

Instantly share code, notes, and snippets.

@proxypoke
proxypoke / fix_python_shebangs
Created August 26, 2014 12:18
Fix broken python code that makes assumptions about /usr/bin/python.
#!/bin/sh
# Fix all shebangs of files in a directory which do not explicitly state the
# major version number of the Python interpreter, ie refer to /usr/bin/python
# and assume that it is 2.x (or 3.x, but most Python 3 projects already use
# /usr/bin/env python3).
echo "Explicit is better than implicit!
This will fix all shebangs referring to /usr/bin/python
in all files below the current directory.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Author: slowpoke <mail+gist@slowpoke.io>
#
# I place this in the Public Domain.
# Do whatever you want. Fuck copywrong.
import os
import time
@proxypoke
proxypoke / anti-license.txt
Created June 27, 2012 08:19
The Anti-License
THE ANTI-LICENSE
ver. β
This is not a license.
This is a manifesto.
There is no copyright.
There is only free information.
There is no intellectual property.
@proxypoke
proxypoke / zfs_aur.patch
Created July 11, 2012 01:59
zfs patch for the AUR package (by green)
diff -Nru zfs.orig/configure.ac-patch zfs/configure.ac-patch
--- zfs.orig/configure.ac-patch 1970-01-01 03:00:00.000000000 +0300
+++ zfs/configure.ac-patch 2012-06-30 23:43:57.168640000 +0400
@@ -0,0 +1,21 @@
+--- configure.ac.orig 2012-06-30 23:38:54.438597000 +0400
++++ configure.ac 2012-06-30 23:40:12.943990000 +0400
+@@ -60,8 +60,18 @@
+ dracut/90zfs/Makefile
+ udev/Makefile
+ udev/rules.d/Makefile
@proxypoke
proxypoke / zfs_aur.patch
Created July 11, 2012 02:05
zfs patch for the AUR package (by green)
diff -Nru zfs.orig/configure.ac-patch zfs/configure.ac-patch
--- zfs.orig/configure.ac-patch 1970-01-01 03:00:00.000000000 +0300
+++ zfs/configure.ac-patch 2012-06-30 23:43:57.168640000 +0400
@@ -0,0 +1,21 @@
+--- configure.ac.orig 2012-06-30 23:38:54.438597000 +0400
++++ configure.ac 2012-06-30 23:40:12.943990000 +0400
+@@ -60,8 +60,18 @@
+ dracut/90zfs/Makefile
+ udev/Makefile
+ udev/rules.d/Makefile
@proxypoke
proxypoke / go_read_the_source.md
Created July 29, 2012 00:00
Go read the source

Go read the source

I'd like to confess something.

In all my time coding Python, which I still consider my primary and favorite language, I haven't read much source code of the standard library, and never once taken a look at the internals of CPython. Okay, I lied, I once read the documentation about the sorting algorithm, [Timsort][], but that's about it.

LD [M] /home/slowpoke/src/linux-ck/zfs/zfs/src/zfs-0.6.0-rc12/module/zfs/zfs.o
Building modules, stage 2.
MODPOST 6 modules
FATAL: modpost: GPL-incompatible module zfs.ko uses GPL-only symbol 'delayed_work_timer_fn'
make[4]: *** [__modpost] Error 1
make[3]: *** [modules] Error 2
make[3]: Leaving directory `/usr/src/linux-3.7.0-1-ck'
make[2]: *** [modules] Error 2
make[2]: Leaving directory `/home/slowpoke/src/linux-ck/zfs/zfs/src/zfs-0.6.0-rc12/module'
make[1]: *** [all-recursive] Error 1
@proxypoke
proxypoke / bernd.py
Last active December 11, 2015 21:58
#!/usr/bin/python
import blackbox
import re
ach = re.compile("(\s+|^)ach\s+[^\s]+\s*", re.I)
def main():
irc = blackbox.IRC(ssl=True)
# Maintainer: Mike Redd <mredd@0tue0.com>
# Contributor: Mike Redd <mredd@0tue0.com>
pkgname=ttf-miso
pkgver=1
pkgrel=1.3
pkgdesc="MISO is an architectural lettering font completed in 2006 by Mårten Nettelbladt."
arch=('any')
license=('custom:free')
url="http://martennettelbladt.se/miso"
depends=('fontconfig' 'xorg-fonts-encodings' 'xorg-font-utils')
#!/usr/bin/env python3
# git.io - generate git.io URLs
#
# Author: slowpoke <mail+git@slowpoke.io>
#
# This program is free software under the non-terms
# of the Anti-License. Do whatever the fuck you want.
# See http://anti-licen.se for a copy.
#
# Github: https://www.github.com/proxypoke/kirschwasser