Skip to content

Instantly share code, notes, and snippets.

View sampottinger's full-sized avatar

A Samuel Pottinger sampottinger

View GitHub Profile
@sampottinger
sampottinger / module.js
Created February 4, 2014 22:15
Module template
function onModuleLoad () {
}
$.ready(function () {
var framework = new Framework();
framework.on('onModuleLoad', onModuleLoad);
//...
$scribeBaseURL = "http://ljsimpleregisterlookup.herokuapp.com/scribe_component?input=";
$escapedInput = urlencode('@registers(' . $view->args[0] . '):' . $view->args[1]);
$renderedHTML = file_get_contents($scribeBaseURL . $escapedInput);
print $renderedHTML;
/**
* Force a redraw on the rendering engine.
**/
function runRedraw()
{
document.body.style.display='none';
document.body.offsetHeight; // no need to store this anywhere, the reference is enough
document.body.style.display='block';
}
@sampottinger
sampottinger / unrolled_future_config.js
Last active August 29, 2015 13:56
Unrolled into futures (time is slipping slipping slipping into the future)
function createAcceptFunc(deferred, valuesDict, setupInfo) {
return function (value) {
valuesDict.set(setupInfo.bindingClass, value);
deferred.resolve();
};
}
function createRejectFunc(deferred, errorDict, setupInfo) {
return function (value) {
@sampottinger
sampottinger / labjack_joystick.py
Last active August 29, 2015 13:56
Concept sketch of what a labjack-controlled virtual joystick might look like if built from a JSON file specification.
"""Sketch of what LabJack as joystick might look like.
@author: Sam Pottinger (samnsparky)
@license: GNU GPL v3
"""
import time
import yaml
@sampottinger
sampottinger / config.yaml
Created February 25, 2014 19:55
test ljjoy configuration
mappings:
- deviceRegister: AIN0
joystickOutputChannel: axis:0
outputStrategy:
name: linear
minDeviceVal: 0
maxDeviceVal: 5
minJoystickVal: 0
maxJoystickVal: 2147483647
- deviceRegister: FIO0

Any chance anyone else is having issues?

Have tried:

commands:
    01_enable_rootaccess:
        command: echo Defaults:root \!requiretty >> /etc/sudoers
    02_no-cert:
        command: sudo /opt/elasticbeanstalk/node-install/node-v0.10.10-linux-x86/lib/node_modules/npm config set ca ""
@sampottinger
sampottinger / dict.js
Created April 30, 2014 02:12
Domenic dict for your browser.
"use strict";
var hasOwnProperty = Object.prototype.hasOwnProperty;
var MANGLE_STRING = "~";
function mangle(key) {
return MANGLE_STRING + key;
}
function unmangle(key) {
@sampottinger
sampottinger / issue10.diff
Created June 10, 2014 03:29
Issue #10 for papel_editor diff
3c3
< "openDate": "2013-11-26",
---
> "openDate": "2014-01-26",
5c5
< "closeDate": "2013-2-18",
---
> "closeDate": "2013-04-18",
13c13,14
< "name": "First Name",
@sampottinger
sampottinger / leopold.ino
Created May 5, 2012 16:21
Leopold the Lizard Logic
/**
* Name: leopold.ino
* Desc: Logic for running Leopold the Lizard
* Auth: Jessica Ebert, Sam Pottinger, DJ Sutton
**/
#include <Servo.h>
#define NECK_SERVO_PIN 5
#define MAIN_LOOP_DELAY 15