Skip to content

Instantly share code, notes, and snippets.

View justinribeiro's full-sized avatar
🌩️
Darkness falls.

Dr. Justin Ribeiro, Ph.D. justinribeiro

🌩️
Darkness falls.
View GitHub Profile
@justinribeiro
justinribeiro / dd-wrt-connect-ping-glass-test
Created July 25, 2013 02:36
This is startup script that runs on dd-wrt, pings my local api end point, which bridges out to Mirror API and sends things to Glass. This is actually a really old script (I used to have this script doing other things), but it's basically a proximity hack (without the GPS). The Mirror API hook basically does location based things (house M2M tasks…
#
# Ping me when Glass connects / DD-WRT start up script
#
# Pings service on connect based on MAC, then pings endpoint which handles Glass talking
#
# Based on some older scripts that I was pretty sure used to be at http://www.dd-wrt.com/wiki/index.php/Script_Examples
# but for the life of me, I can't recall which ones
#
# Setup some devices based on MAC address
@justinribeiro
justinribeiro / detect-tuio.js
Created April 10, 2012 22:46
Modernizr test for npTuioClient
//
// Fast test for npTuioClient plugin https://github.com/fajran/npTuioClient
// Tested with PQ Labs touch overlay devices
//
// Chances are good if you use this, you'll want the Boris' MagicTouch
// touch api polyfill: https://github.com/borismus/MagicTouch
//
Modernizr.addTest('tuio', function () {
return ((typeof navigator.plugins != "undefined" && typeof navigator.plugins["Tuio Client browser plugin"] == "object"));
@justinribeiro
justinribeiro / jqueryConverterGooglePlus.js
Created November 16, 2011 01:59
jQuery AJAX converter for getGooglePlus.php example JSON
$.ajax({
url: "getGooglePlus.php",
dataType: "jsong",
converters: {
"json jsong": function( msg ) {
var retData = new Array();
for (var i = 0; i < msg.items.length; i++) {
if ( msg.items[i].object.hasOwnProperty( "attachments" ) && msg.items[i].object.attachments.length >= 1)
{
for (var j = 0; j < msg.items[i].object.attachments.length; j++)
@justinribeiro
justinribeiro / getGooglePlus.php
Created November 16, 2011 01:56
Get's a Google Plus stream in JSON and caches locally for display elsewhere
// JDR: who you are, and how many results you want
$myGooglePlusUser = "{YOUR_GOOGLE_PLUS_ID_NUMBER_HERE}";
$myGooglePlusMaxResults = 20;
// JDR: get your Google API key from the APIs Console: https://code.google.com/apis/console#access
$myGoogleAPIkey = "{YOUR_API_KEY_HERE}";
$myGooglePlusQuery = "https://www.googleapis.com/plus/v1/people/" . $myGooglePlusUser . "/activities/public?alt=json&maxResults=" . $myGooglePlusMaxResults . "&fields=items(object(attachments(categories%2Ccontentsource%2CdisplayName%2CobjectType%2Curl)%2Curl))&pp=1&key=" . $myGoogleAPIkey;
$myCacheFile = "me.json"; // JDR: name the cache file whatever you like
$myCacheCycle = "600"; // JDR: in seconds
@justinribeiro
justinribeiro / #jqcon 2011 session slides
Created April 18, 2011 15:35
Exported from Session Buddy; use "Import Session..." in Session Buddy to open all
http://events.jquery.org/2011/sf-bay-area/schedule/
http://danheberden.com/presentations/deferreds-putting-laziness-to-work/#1
http://boazsender.com/understanding-jquery-events.html
http://standardista.com/jquery/
http://www.slideshare.net/darcyclarke/mind-blowingux
http://demo.creative-area.net/jqcon2011/#1
http://www.slideshare.net/nzakas/progressive-enhancement-20
http://filamentgroup.com/lab/slides_from_our_jquery_conference_presentation_on_jquery_mobile/
http://www.coldfusionjedi.com/index.cfm/2011/4/16/Slides-code-from-my-jQuery-Mobile-presentation
http://code.bocoup.com/popcorn.js/jqcon/#landing-slide