Skip to content

Instantly share code, notes, and snippets.

@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 / 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 */
padsp /opt/java/jre/bin/java -Dslimserver=127.0.0.1 -Dskins=headless -jar SoftSqueeze.jar
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() ;
}
});
});
<?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;
/**
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
-- 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 ),
)