Skip to content

Instantly share code, notes, and snippets.

View birkir's full-sized avatar
👋
Howdy

Birkir Gudjonsson birkir

👋
Howdy
View GitHub Profile
@birkir
birkir / Advania.js
Created October 24, 2012 10:33
Advania JS Library
var Advania = {
Plugins: {
/**
* Tab control plugin
* TODO: add state to cookies
*
* @return void
*/
<?php
class Inflector extends Kohana_Inflector {
public static function plural_icelandic($word, $count = NULL)
{
$count = ($count === NULL) ? 0.0 : (float) $count;
if ($count == 1)
return $word;
/**
* Arduino based "2-step launch control"
* Works by interrupt power signal to ignition coil.
* Requires RPM and Clutch signal
*
* @author Birkir Gudjonsson (birkir.gudjonsson@gmail.com)
* @licence http://en.wikipedia.org/wiki/BSD_licenses
*/
// settings
@birkir
birkir / Bootstrap.php
Last active September 30, 2022 11:51
Twitter Bootstrap helper module for Kohana 3.3 (DRAFT)
<?php
/**
* Twitter Bootstrap Kohana helper
*
* example of use:
* <?=Bootstrap::grid($grid, Bootstrap::FLUID);?>
* <?=$grid->span($view, 4);?>
* <?=Bootstrap::icon('download', TRUE);?>
* <?=Bootstrap::button('Button'); ?>
@birkir
birkir / fg.ipod.js
Created March 5, 2013 11:27
FilamentGroup iPod style menu
/*--------------------------------------------------------------------
Scripts for creating and manipulating custom menus based on standard <ul> markup
Version: 3.0, 03.31.2009
By: Maggie Costello Wachs (maggie@filamentgroup.com) and Scott Jehl (scott@filamentgroup.com)
http://www.filamentgroup.com
* reference articles: http://www.filamentgroup.com/lab/jquery_ipod_style_drilldown_menu/
Copyright (c) 2009 Filament Group
Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses.
<?php
/** phpSerial = https://php-serial.googlecode.com/svn/trunk/php_serial.class.php **/
include "php_serial.class.php";
/**
* Wireless Sensors middle-layer-class
*
* @require phpSerial
body {
padding-top: 100px;
}
.navbar-masthead {
top: 30px;
}
@birkir
birkir / xslt-fixer.js
Last active December 17, 2015 06:49
- Removes msxml:script elements, prefixes and their functions used in context. - Fixes API changes to get property values.
/**
* Find all the evil jscript and integrate new property values
*
* @return void
*/
(function () {
// scope jquery
var $ = window.jQuery,
@birkir
birkir / sensor.cpp
Last active December 17, 2015 07:19
Arduino node has Ultrasonic sensor feeding data that sends 2.4Ghz signal to a server connected via Serial. It acts as one-sided sprint gate for testing run time.
#include <SPI.h>
#include <Mirf.h>
#include <nRF24L01.h>
#include <MirfHardwareSpiDriver.h>
// structure for gate packet
typedef struct {
int Identity;
boolean State;
float Distance;
@birkir
birkir / bmw-ibus.cpp
Created May 14, 2013 15:14
BMW I-Bus monitor and decoder
/**
* BMW IBus Daemon reads BMW IBus data through serial port. It detects
* BMW board monitor(at least BM53) unit and steering wheel button presses
* from IBus data, maps them to key events and injects them to system event
* queue via uinput.
*
* It also can be configured to inject key events only in certain state like
* TAPE or AUX which can be useful if you want to hijack for example TAPE
* mode for other use.
*