Skip to content

Instantly share code, notes, and snippets.

View subutux's full-sized avatar

Stijn Van Campenhout subutux

  • dotArchie NV
  • Belgium
  • 14:09 (UTC -12:00)
  • X @subutux
View GitHub Profile
@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',
@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;
@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`
@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)
@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active March 21, 2024 23:00
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@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
@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):
// 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"
@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.

@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 (