Skip to content

Instantly share code, notes, and snippets.

View ludoo's full-sized avatar

Ludovico Magnocavallo ludoo

View GitHub Profile

Keybase proof

I hereby claim:

  • I am ludoo on github.
  • I am ludo (https://keybase.io/ludo) on keybase.
  • I have a public key whose fingerprint is 24E8 F579 AC68 7C53 5C10 1330 51F7 C50D 0035 50F2

To claim this, I am signing this object:

@ludoo
ludoo / !Simple Stackdriver custom metrics
Last active February 6, 2022 15:25
Simple Stackdriver custom metrics
foo! spam! eggs! name this gist!
@ludoo
ludoo / aggregate_concat.py
Created October 28, 2014 13:18
Django aggregates GROUP_CONCAT support for MySQL
"""
From http://harkablog.com/inside-the-django-orm-aggregates.html
with a couple of fixes.
Usage: MyModel.objects.all().annotate(new_attribute=Concat('related__attribute', separator=':')
"""
from django.db.models import Aggregate
from django.db.models.sql.aggregates import Aggregate as SQLAggregate
@ludoo
ludoo / gtk_remove_decorations.py
Created October 28, 2014 08:18
Remove GTK window decorations for a named window
#!/usr/bin/env python
import sys
try:
from gtk import gdk
except ImportError:
raise SystemExit("You need to have python-gtk installed for this to work")
@ludoo
ludoo / index.html
Created February 28, 2013 16:48
Separate d3.scale.category20 colors into dark and light ranges
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<style type="text/css">
h3 {
clear: left;
margin: 0;
}
ul {
@ludoo
ludoo / indicator-traffic.py
Created September 20, 2012 08:20
Quick and dirty network load app indicator for ubuntu
#!/usr/bin/env python
# encoding: utf-8
import time
import gtk
import glib
import appindicator
class AppIndicatorExample: