Skip to content

Instantly share code, notes, and snippets.

View subutux's full-sized avatar

Stijn Van Campenhout subutux

  • dotArchie NV
  • Belgium
  • 10:16 (UTC -12:00)
  • X @subutux
View GitHub Profile
@evoL
evoL / gist:1650115
Created January 20, 2012 23:07
Gtk Multi Autocomplete
import pygtk
pygtk.require("2.0")
import gobject
import gtk
from gtk import gdk
class EntryMultiCompletion(gtk.Entry):
def init(self):
gtk.Entry.init(self)
// valac --thread --pkg json-glib-1.0 json.vala
using Json;
int main(string[] args) {
size_t length;
string json;
string[] std_fields = {
"param1", "param2", "param3",
"param4", "param5", "param6"
@colonD
colonD / logstash_daily.sh
Created January 4, 2012 18:00
Quick cron.daily script for stock Logstash/ES installation
#!/bin/sh
# Do elasticsearch optimize on logstash previous day index
# if $1 = all then optimize all indicies
esindex="/opt/elasticsearch/data/elasticsearch/nodes/0/indices"
# Grab yesterday's values
D=`date +%d -d yesterday`
M=`date +%m -d yesterday`
Y=`date +%Y -d yesterday`
@lithid
lithid / Grid
Created February 20, 2013 02:05
Here is a grid using python and GTK3, loading dynamically based on window size/re-size. I came up with this example while trying to mimic a gridview of images for a wallpaper application. The example is below.
#!/usr/bin/env python2
from gi.repository import Gtk
class Grid(Gtk.Window):
widget_list = []
WIDGET_SIZE = 140
COLS = 1
NUM = 100
def calcule_columns(self, scroll, grid):
@subutux
subutux / denonavr.py
Created November 8, 2016 11:26
A home assistant media player component for denon AVR-XXXX recievers
"""
Support for Denon AVR Receivers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.denonavr/
"""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.components.media_player import (
@dz0ny
dz0ny / 99java
Created July 7, 2012 10:23
Install java,flash,mp3,mp4 to Chromium OS
## Setup java
if [ `uname -m` == 'x86_64' ]; then
PATH="/usr/lib64/jvm/java-7-oracle/jre/bin/"
JAVA_HOME="/usr/lib64/jvm/java-7-oracle/"
else
PATH="/usr/lib/jvm/java-7-oracle/jre/bin/"
JAVA_HOME="/usr/lib/jvm/java-7-oracle/"
fi
@strathmeyer
strathmeyer / handlebars.object_helpers.js
Created November 16, 2011 21:57
Handlebars.js helpers to iterate over objects
// HELPER: #key_value
//
// Usage: {{#key_value obj}} Key: {{key}} // Value: {{value}} {{/key_value}}
//
// Iterate over an object, setting 'key' and 'value' for each property in
// the object.
Handlebars.registerHelper("key_value", function(obj, fn) {
var buffer = "",
key;
@tobitailor
tobitailor / get_barcode_from_image.js
Created June 1, 2010 19:33
Barcode recognition with JavaScript - Demo: http://bit.ly/djvUoy
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',
@namuol
namuol / INSTALL.md
Last active July 24, 2023 11:53
rage-quit support for bash

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

@yvh
yvh / README.md
Last active January 10, 2024 21:12
English language locale for Belgium (Ubuntu, Debian, ...)

English language locale for Belgium on Ubuntu, Debian and others linux systems

sudo cp en_BE /usr/share/i18n/locales/en_BE
sudo localedef -i en_BE -c -f UTF-8 en_BE
echo "en_BE.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
sudo locale-gen

Maybe also change files in /var/lib/locales/supported.d/