Skip to content

Instantly share code, notes, and snippets.

@inktrap
inktrap / pelican jinja2 macros
Last active April 28, 2016 16:39
Various jinja2 macros used by my port of the uikit theme to pelican.
% some macros for pelican
@inktrap
inktrap / pythoscope-bug.py
Last active April 28, 2016 16:36
pythoscope fails on --init with UnicodeDecodeError.
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
from __future__ import print_function
def foobar():
print("foobarł…“ſŧ→”ſ“¶ŋæ¶øæ„")
foobar()
@inktrap
inktrap / cowsay-pretty.sh
Last active February 24, 2016 11:40
With this awesome script all the worries are finally over! Cowsay will print fortunes, but the speech bubble will stay the same size (height, width) no matter what. Fortunes are choosen with a length limit, so they dont have to be cut. Don't miss this, this is huge! Or small, depends on your settings.
#!/bin/bash
# author: Valentin Heinz valentin@inktrap.org
# License: GPL
# configurable script to print fortunes via cowsay, so the speech bubble won't
# change in size and width.
HLIMIT=$1
#HLIMIT=$(($1-5))
#!/usr/bin/env python
import nltk
import sys
import datetime
import matplotlib.pyplot as plt
import csv
LIMIT=14
grammar = nltk.CFG.fromstring("""
S -> NP VP