Skip to content

Instantly share code, notes, and snippets.

@gandaro
gandaro / monitor.py
Last active December 17, 2015 01:09
# coding: utf-8
# monitor - XChat plugin for the IRCv3.2 command MONITOR
# Copyright (C) 2013 Jakob Kramer <jakob.kramer@gmx.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@gandaro
gandaro / gist:3194136
Created July 28, 2012 17:41
Installing HexChat on Ubuntu

How to Build HexChat on Ubuntu

Install automake, libtool, glib, GTK+ and libxml2 (for Python plugin support you also need python-dev):

# apt-get install automake1.10 libtool libglib2.0-dev libgtk2.0-dev libxml2-dev

Create the configure script:

$ ./autogen.sh
@gandaro
gandaro / ta1.mdown
Created April 15, 2012 10:09 — forked from sma/ta1.mdown
Erster Teil eines Tutorial, das ein Textadventure in Python entwickelt

Ein Textadventure (auch Interactive Fiction genannt) ist eine Spielegattung aus den frühen 80er Jahren, in der der Computer Schauplätze, Gegenstände und Personen per Text beschreibt und der Spieler einfache Befehle wie "go north" oder "take the brass lantern" gibt, um mit dem Spiel zu interagieren und letztlich interaktiv eine Geschichte erlebt, in der er Rätsel lösen muss oder überleben oder was auch immer.

Diese wenig kreative Geschichte soll als Beispiel dienen: Wir stehen vor einer alten trutzigen Burg mit hohen Mauern und tiefem Graben und haben ein Seil und Brot dabei. Von dort können wir über eine Zugbrücke in den verfallenen Burghof gehen. Vögel flattern auf und wir treffen Hugo, der bewaffnet mit einem Schwert, nicht wagt, in die Kellergewölbe zu gehen. Wir können den Burgfried besteigen und finden dort Ratten, die ein Nest mit einer Kiste mit Silbermünzen bewachten. Mit dem Brot können wir die Ratten weglocken und die Münzen nehmen. (Alt

@gandaro
gandaro / gist:2388025
Created April 14, 2012 21:47
Small script that I configured as "Copy Dropbox link" action in Thunar
#!/bin/bash
url=$(dropbox puburl "$1")
if [[ "$url" == http* ]]; then
echo -n $url | sed s/http/https/ | xclip -selection clipboard
fi
@gandaro
gandaro / bitarray.c
Created March 27, 2012 18:27
A simple bit array implementation.
#include "bitarray.h"
void toggle_bit(char *array, int index)
{
array[index/8] ^= 1 << (index % 8);
}
char get_bit(char *array, int index)
{
return 1 & (array[index/8] >> (index % 8));
@gandaro
gandaro / hello.S
Created March 3, 2012 16:48
“Hello world” written using NASM assembly
section .data
hello: db "Hello world!",0xa
length: equ $-hello
section .text
global _start
_start:
mov eax, 4 ; write(1, hello, length)
mov ebx, 1
mov ecx, hello
@gandaro
gandaro / hello.S
Created March 3, 2012 15:55
“Hello world” written using AT&T assembly
.data
hello:
.string "Hello world!\n"
.text
.globl _start
_start:
movl $4, %eax # write(1, hello, strlen(hello))
movl $1, %ebx
movl $hello, %ecx
@gandaro
gandaro / playlist-dl.py
Created February 7, 2012 16:58
A script used to convert YT to M3U playlists and play them without Flash
#!/usr/bin/env python3
# coding: utf-8
# playlist-dl This program can be used to convert YouTube playlists to M3U
# playlists
# Copyright (C) 2012 Jakob Kramer
# 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