Skip to content

Instantly share code, notes, and snippets.

View loadedsith's full-sized avatar

Graham P Heath loadedsith

View GitHub Profile
@loadedsith
loadedsith / jquery.getParam.js
Last active December 19, 2015 21:39 — forked from lunaroja/jquery.getParam.js
Jquery / Zepto agnostic plugin version of jquery.getParam() for grabbing the parameters out of the uri
;(function($){
$.extend($, {
getParam: function(n,u) {
if(!u) var u = window.location.search;
var match = RegExp('[?&]' + n + '=([^&]*)').exec(u);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}
})
})(window.Zepto || window.jQuery)
@loadedsith
loadedsith / php_serial.class.php
Created August 27, 2012 05:27 — forked from ahutchings/php_serial.class.php
PHP Serial Port Control Class by Rémy Sanchez with Modifications for OS X (Updated for 10.8 Mountain Lion, byGPH)
<?php
define ("SERIAL_DEVICE_NOTSET", 0);
define ("SERIAL_DEVICE_SET", 1);
define ("SERIAL_DEVICE_OPENED", 2);
/**
* Serial port control class
*
* THIS PROGRAM COMES WITH ABSOLUTELY NO WARANTIES !
* USE IT AT YOUR OWN RISKS !