Skip to content

Instantly share code, notes, and snippets.

View RavuAlHemio's full-sized avatar

Ondřej Hošek RavuAlHemio

View GitHub Profile
@RavuAlHemio
RavuAlHemio / fuelrod_config_diagrammer.py
Created July 29, 2013 01:30
Fuel rod configuration diagram creation script.
#!/usr/bin/env python3
# Creates fuel-rod diagrams.
import re
MARGIN_TOP = 4.5
MARGIN_LEFT = 4.5
MARGIN_RIGHT = 5.5
MARGIN_BOTTOM = 5.5
BOX_WIDTH = 50
@RavuAlHemio
RavuAlHemio / winfixres.c
Created July 27, 2013 19:39
Changes the resolution of a display on Windows. Useful for fixing the size of Wine's virtual desktop.
/**
* Changes the resolution of a display on Windows.
* Useful for fixing the size of Wine's virtual desktop.
*
* Released into the public domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
#include <stdio.h>
#include <wchar.h>
@RavuAlHemio
RavuAlHemio / pounceandwrite.c
Created July 27, 2013 19:38
Pounce-and-write. Waits until a file is accessible, then either writes a set of lines into it or executes a command.
/**
* Pounce-and-write. Waits until a file is accessible, then either writes a set
* of lines into it or executes a command.
*
* Released into the public domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
#include <errno.h>
#include <stdbool.h>
@RavuAlHemio
RavuAlHemio / potatopercentage.c
Created July 27, 2013 19:36
Fetch the current battery percentage from UPower and output it.
/**
* @file potatopercentage.c
* @brief Fetch the current battery percentage from UPower and output it.
*
* Released into the public domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
#include <math.h>
#include <stdarg.h>
@RavuAlHemio
RavuAlHemio / magnetophon.cpp
Created July 27, 2013 19:36
Magnetophon: simulates the frequency oscillation in a broken tape deck or damaged tape using SoundTouch and SoX.
/**
* Simulates the frequency oscillation in a broken tape deck or damaged tape
* using SoundTouch and SoX.
*
* Released into the public domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
#include <string>
@RavuAlHemio
RavuAlHemio / gresenter.py
Created July 27, 2013 19:34
Gresenter: the two-window PDF presentation viewer
#!/usr/bin/env python2
# Gresenter: the two-window PDF presentation viewer
# One window: presentation (projector)
# Other window: presentation and notes (two different PDF files) side by side
# (laptop screen)
#
# Released into the public domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from gi.repository import Gtk, Gdk, Poppler, Pango
@RavuAlHemio
RavuAlHemio / smuxi-smartlink-perftest.patch
Created June 25, 2013 00:00
Smuxi smart-link performance test
/* on Linux, compile me with: gcc -shared -o foreach.so foreach.c */
#include <stddef.h>
typedef wchar_t (*transform_wct)(wchar_t);
void foreachwchar(wchar_t *cs, transform_wct func)
{
while (cs[0] != L'\0')
{
@RavuAlHemio
RavuAlHemio / pebble-libc-symbols.txt
Created May 27, 2013 19:46
Pebble SDK libc symbol list
# Generated using nm libc.a | grep " T " | awk '{ print $3 }'
a64l
abort
abs
access
__adjust
__aeabi_atexit
__aeabi_memclr
__aeabi_memclr4
__aeabi_memclr8
@RavuAlHemio
RavuAlHemio / PKGBUILD-lua-lgi-git
Created April 10, 2013 17:06
pacman-4.1-compatible PKGBUILD for lua-lgi-git
# Maintainer: speps <speps at aur dot archlinux dot org>
_name=lua-lgi
pkgname=$_name-git
pkgver=20130410
pkgrel=1
pkgdesc="Lua binadings for gnome/gobject using gobject-introspection library."
arch=(i686 x86_64)
url="https://github.com/pavouk/lgi"
license=('custom:MIT')