Skip to content

Instantly share code, notes, and snippets.

-- either add to the clientkeys or add to rc.lua at the end
clientkeys = awful.util.table.join(clientkeys,
awful.key({ modkey, }, "s", function (c) c.ontop = not c.ontop end ),
awful.key({ modkey, }, "s", function (c) c.sticky = not c.sticky end ),
)
hostname = io.popen("uname -n"):read()
-- Default modkey.
if hostname == "hal-9000" then
modkey = "Mod4" -- WIN
modkey2 = "Mod1" -- ALT
else
modkey = "Mod1" -- ALT
modkey2 = "Mod3" -- CTRL
<?php
/*
* Extended Doctrine Query class providing a few additional functions
* for wrapping your where clauses more efficiently
*/
class Doctrine_Query_Extra extends Doctrine_Query
{
protected $_startClause = false;
/**
jQuery(document).ready(function($){
$(document).ajaxError(function(e, xhr, settings, exception) {
//if the status of an ajax call is 401 reload the page
//depending on you requirements you can specify window.location = http://...
if(xhr.status == 401){
window.location.reload() ;
}
});
});
padsp /opt/java/jre/bin/java -Dslimserver=127.0.0.1 -Dskins=headless -jar SoftSqueeze.jar
@kabturek
kabturek / pins_arduino.c
Created July 14, 2011 10:37
Arduino port mapping with additional pins PB6 & PB7
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
PD, /* 0 */
PD,
PD,
PD,
PD,
PD,
PD,
PD,
PB, /* 8 */
@kabturek
kabturek / lillypad.sh
Created July 14, 2011 11:18
Burning the lillypad bootloader
#arduino/hardware/arduino/bootloaders/lilypad
#these fuses are for the lilypad with atmega 168! for other chips see arduino/hardware/arduino/boards.txt
avrdude -c usbtiny -p m168 -B 5 -V -e -U lock:w:0x3F:m -U hfuse:w:0xdd:m -U lfuse:w:0xe2:m -U efuse:w:0x00:m
avrdude -c usbtiny -p m168 -B 1 -V -D -U flash:w:LilyPadBOOT_168.hex:i
avrdude -c usbtiny -p m168 -B 5 -V -U lock:w:0x0F:m
@kabturek
kabturek / .bashrc
Created September 21, 2011 20:17
Getting vim/gvim to work with other ruby versions than the one that is compiled with. (when using it with vim from ubuntu repos - compiled againt ruby1.8 with rvm using 1.9.2)
gvim()
{
(unset GEM_PATH GEM_HOME; command gvim "$@")
}
vim()
{
(unset GEM_PATH GEM_HOME; command vim "$@")
}
@kabturek
kabturek / run_tags.rb
Created November 16, 2011 21:55 — forked from tobias/run_tags.rb
A script for generating TAGS from a git hook.
#!/usr/bin/env ruby
#-*-ruby-*-
# A script to run ctags on all .rb files in a project. Can be run on
# the current dir, called from a git callback, or install itself as a
# git post-merge and post-commit callback.
CTAGS = '/opt/local/bin/ctags'
HOOKS = %w{ post-merge post-commit post-checkout }
HOOKS_DIR = '.git/hooks'
@kabturek
kabturek / .gntrc
Created November 22, 2011 12:13
finch config for irssi layout ~/.gntrc
[general]
shadow = 0
# There is experimental mouse support
mouse = 0
# To use some custom window-manager
wm = /usr/lib/gnt/irssi.so