Skip to content

Instantly share code, notes, and snippets.

View ianjosephwilson's full-sized avatar

Ian Wilson ianjosephwilson

View GitHub Profile
from time import sleep
from Arduino import Arduino
import logging
import sys
board = Arduino(port='/dev/ttyACM0')
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
# There should only be a few permissions across your whole application.
permissions = {
'view': 'view',
}
class RegContextFactory():
@property
def __acl__(self):
@ianjosephwilson
ianjosephwilson / gist:9213821
Last active August 29, 2015 13:56
postgis dependencies
$ sudo apt-get install postgresql-9.1-postgis
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
fontconfig hicolor-icon-theme libatk1.0-0 libatk1.0-data libavahi-client3 libavahi-common-data libavahi-common3 libcairo2 libcups2 libdatrie1 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgeos-3.3.3
libgeos-c1 libgraphite2-3 libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libharfbuzz0a libjasper1 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpixman-1-0 libproj0 libthai-data libthai0 libxcb-render0
libxcb-shm0 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxinerama1 libxrandr2 libxrender1 postgis proj-data
Suggested packages:
cups-common librsvg2-common gvfs libjasper-runtime ttf-baekmuk ttf-arphic-gbsn00lp ttf-arphic-bsmi00lp ttf-arphic-gkai00mp ttf-arphic-bkai00mp proj-bin
ian@bumblebee ~/workspace/seed-project/lever $ npm install
npm ERR! peerinvalid The package grunt-contrib-connect does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer grunt-contrib@0.9.0 wants grunt-contrib-connect@~0.6.0
npm ERR! System Linux 3.8.13-gentoo
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/ian/workspace/seed-project/lever
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR! code EPEERINVALID
controllers.controller('MainCtrl', function( $scope, $location,
AuthService, NoteService, _, ga ){
$scope.user = null;
$scope.showSearch = false;
window.console.log('what is happening');
window.console.log('_', _, typeof _);
window.console.log('ga', ga, typeof ga);
// ...
});
function works() {
var promise = getPromise();
promise.then(first_success, first_error);
promise.then(second_success, second_error);
return promise;
}
function doesNotWork() {
var promise = getPromise();
promise.then(first_success, first_error).then(second_success, second_error);
import logging
from trytond.model import Workflow, ModelView, ModelSQL, fields
from trytond.pyson import Eval, Or, And, Not, Bool, Equal
from trytond.wizard import Wizard, StateView, StateTransition, Button
from trytond.transaction import Transaction
from trytond.pool import Pool, PoolMeta
from trytond.rpc import RPC
__metaclass__ = PoolMeta
/**************************************************************************\
* Pinoccio Library *
* https://github.com/Pinoccio/library-pinoccio *
* Copyright (c) 2014, Pinoccio Inc. All rights reserved. *
* ------------------------------------------------------------------------ *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the MIT License as described in license.txt. *
\**************************************************************************/
#include <SPI.h>
#include <Wire.h>
//a data pin
//b clock pin
//c control variable, temperature or humidity or nothing
//m most sig
//l least sig
//r result
//w waiting for d4
function sht.report {
print "sht.report";
//a data pin
//b clock pin
//r result
//w poll timeout
function sht.temp.report {
print "s.r.t";
f = key(arg(1));
hq.report("rawtemp", f);
free f;