Skip to content

Instantly share code, notes, and snippets.

View agateau's full-sized avatar

Aurélien Gâteau agateau

View GitHub Profile
@agateau
agateau / cp-clementine-covers.py
Created March 27, 2012 14:33
Copy album covers downloaded by Clementine in the matching album dir
#!/usr/bin/env python
# encoding: utf-8
# Author: Aurélien Gâteau <[email protected]>
# License: GPLv3+
import filecmp
import os
import shutil
import sqlite3
@agateau
agateau / pyqt-webkit-tut2.py
Created January 20, 2012 13:36
Demonstrate how to expose a PyQt object to QWebView
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
class Foo(QObject):
@pyqtSlot(int, result=int)
def compute(self, value):
return value * 2
@agateau
agateau / pict-exif-rename
Created January 4, 2012 21:48
Rename pictures according to their exif information, taking sequence number into account
#!/usr/bin/env python
# encoding: utf-8
"""
pict-exif-rename: Rename pictures according to their exif information, taking
sequence number into account.
This relies on the presence of the Exif.Panasonic.SequenceNumber tag, so may
not work with all cameras.
@agateau
agateau / pkgcgrep.sh
Created September 29, 2011 13:36
Search through pkgconfig files
function pkgcgrep() {
pkg-config --list-all | grep "$1"
}
@agateau
agateau / wide-i18n-strings.cpp
Created December 24, 2010 13:31
Debug issues when strings get too wide to fit a window by prefixing translated strings with a custom string
QString wide_prefix()
{
return qgetenv("WIDE");
}
inline QString wide_i18n(const char* txt)
{
return wide_prefix() + i18n(txt);
}