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 / 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')
@RavuAlHemio
RavuAlHemio / sm-tf2-directory.patch
Created March 30, 2013 14:23
Convert the smf-tf2.games.txt gamedata definition into the folder format. This is the "wrong" solution to the problem and is only kept here for posterity.
diff -r 6ce275678a11 gamedata/sm-tf2.games.txt
--- a/gamedata/sm-tf2.games.txt Fri Mar 29 13:10:51 2013 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-/**
- * Do not edit this file. Any changes will be overwritten by the gamedata
- * updater or by upgrading your SourceMod install.
- *
- * To override data in this file, create a subdirectory named "custom" and
- * place your own gamedata file(s) inside of it. Such files will be parsed
@RavuAlHemio
RavuAlHemio / moved.txt
Last active December 15, 2015 01:39
SourceMod gamedata definitions for the SteamPipe betas of Source games
Slowly but surely, the gist became difficult to maintain. The game data have moved to:
https://github.com/RavuAlHemio/sourcemod-beta-gamedata
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index d50b783..5ded798 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -155,6 +155,15 @@ PHP_MINIT_FUNCTION(ldap)
REGISTER_LONG_CONSTANT("LDAP_DEREF_FINDING", LDAP_DEREF_FINDING, CONST_PERSISTENT | CONST_CS);
REGISTER_LONG_CONSTANT("LDAP_DEREF_ALWAYS", LDAP_DEREF_ALWAYS, CONST_PERSISTENT | CONST_CS);
+ /* Constants to be used with ldap_modify_batch() */
+ REGISTER_LONG_CONSTANT("LDAP_MODIFY_BATCH_ADD", LDAP_MODIFY_BATCH_ADD, CONST_PERSISTENT | CONST_CS);