Skip to content

Instantly share code, notes, and snippets.

{
HighestSeverity: 'SUCCESS',
Notifications: [
{
Severity: 'SUCCESS',
Source: 'locs',
Code: '000',
Message: 'SUCCESS',
LocalizedMessage: 'SUCCESS'
}
@anthonywebb
anthonywebb / debug.ino
Created August 21, 2015 23:38
WiFi.listen() issues
STARTUP(WiFi.selectAntenna(ANT_EXTERNAL));
// we will handle wifi manually
SYSTEM_MODE(SEMI_AUTOMATIC);
void setup() {
Serial.begin(9600); // open serial over USB
delay(3000);
void setup() {
// put your setup code here, to run once:
byte ON[]={0xA5,0x05,0x4C,0x4C,0x42};
KIRSP_cal_CRC16(ON, 5);
}
void loop() {
// put your main code here, to run repeatedly:
}
@anthonywebb
anthonywebb / gist:6325443
Created August 24, 2013 01:21
Basic node HTTP Server
var http = require('http');
var url = require('url');
var host = '127.0.0.1';
var port = 8080;
var zones = ["P9_11","P9_13","P9_15","P9_17","P9_21","P9_23","P9_25","P9_27","P9_28","P9_26","P9_24","P9_22","P9_18","P9_16","P9_14","P9_12"];
var rain = 'P9_29';
var button = 'P9_30';
var b = require('bonescript');
var state = b.LOW;
b.pinMode("P9_15", b.OUTPUT, 7, 'pulldown', 'fast');
b.pinMode("P9_17", b.OUTPUT, 7, 'pulldown', 'fast');
setInterval(toggle, 1000);
function toggle() {
if(state == b.LOW) state = b.HIGH;
var b = require('bonescript');
var state = b.LOW;
b.pinMode("P9_15", b.OUTPUT);
b.pinMode("P9_17", b.OUTPUT);
setInterval(toggle, 1000);
function toggle() {
if(state == b.LOW) state = b.HIGH;
function parseStreamUrl(url,i) {
// some entries are actually just direct stream urls
if (url.indexOf(".asx") !== -1 || url.indexOf(".pls") !== -1) {
request.get(url,function (error, response, body) {
if (!error && response.statusCode == 200) {
// asx hides stuff in XML
if(url.indexOf(".asx") !== -1){
var stream = $(body).find("entry:first").find("ref").attr("href");
}
// everything else should be able to be regex'd out
@anthonywebb
anthonywebb / gist:1601967
Created January 12, 2012 17:37
http test
//******************************
// BUILD THE HTTP SERVER
//******************************
var express = require('express');
var app = express.createServer();
app.get('/login', function(req, res){
console.log("hit the login");
res.send('you hit the login');
});