Skip to content

Instantly share code, notes, and snippets.

View No9's full-sized avatar
🦀
Rusting with a slight chance of code

Anton Whalley No9

🦀
Rusting with a slight chance of code
View GitHub Profile
@No9
No9 / host-multiaction.js
Created April 16, 2014 13:21
A POC for issue. Save it in the test folder next to host.js
var test = require("tap").test;
var assert = require('assert');
var http = require('http');
var httpProxy = require('http-proxy');
// Create an array of selects that harmon will process.
var actions = [];
// Create a simple action
Hours in a year 8765
On demand
$0.154 / Hour = 8765
8765 * 0.127 = 1113.155
$220 $0.127 per Hour 1,349.81 for a Medium Instance
@No9
No9 / hyperscript.js
Last active August 29, 2015 14:24
A tongue in cheek implementation of hyperscript to illustrating a 'pure ui' approach
// Based on http://rauchg.com/2015/pure-ui/
var h = require('hyperscript')
function dashboard(opts){
// with proper access to the layout data
// data CSS media queries can be redundant
if (opts.width > 375) {
return h('div', 'Twitter followers ' + opts.num)
} else {
return h('div', 'Twitter followers ' + (opts.num / 1000) + 'K')
@No9
No9 / installnode.sh
Created September 11, 2015 23:56
Install node on a base illumOS install
#/bin/sh
pkgin in git
pkgin in gcc49
pkgin in gmake
export PATH=$PATH:/opt/local/gcc49/bin
git clone https://github.com/nodejs/node.git
cd node
#Make sure to change version
git checkout v4.0.0
var app = require('http').createServer(handler)
, fs = require('fs')
app.listen(8090);
function handler (req, res) {
fs.readFile(__dirname + '/index.html',
function (err, data) {
if (err) {
res.writeHead(500);
@No9
No9 / gist:3184960
Created July 26, 2012 22:24
WebOS Emulator on Ubuntu 12.04 Notes

Getting WebOS up and running on Ubuntu 12.04

These notes are a direct copy from my open tabs and command line when I successfully got the emulator up and running. I may have missed something so please add your findings.

Install Python2.6

http://askubuntu.com/questions/125342/how-can-i-install-python-2-6-on-12-04

$ sudo add-apt-repository ppa:fkrull/deadsnakes
$ sudo apt-get update
@No9
No9 / nodebuild
Created October 13, 2012 18:25
Checkout and build node on OpenIndiana
#!/usr/gnu/bin/sh
export CC=/usr/gnu/bin/gcc
cd ~/github/node
git reset --hard HEAD
git clean -f
git pull
#Make sure to change version
git checkout v0.8.11
./configure --with-dtrace
@No9
No9 / motor.js
Created October 24, 2012 21:31
Motor Shield Johnny-Five Sketch
var five = require("johnny-five"),
// or "./lib/johnny-five" when running from the source
board = new five.Board();
board.on("ready", function() {
var MOTOR1 = 12;
var MOTOR2 = 13;
var BREAK1 = 9;
var BREAK2 = 8;
var SPEEDPIN1 = 3;
@No9
No9 / NodeandOpenIndiana.md
Last active October 12, 2015 05:18
Install Openindiana and Node.js
layout title author
post
node.js & OpenIndiana
Anton Whalley

Introduction

At nearform we recommend Joyent to our customers for production deployment of projects. The default operating system we normally choose is SmartOS.

@No9
No9 / gist:3986224
Created October 31, 2012 10:05
Initial sketch for streaming to Firmata
var sys = require("sys");
var net = require("net");
var firmata = require("firmata");
var times = 0;
var client = net.connect( 4444, '192.168.1.37', function() {
var ledPin = 13;
var board = new firmata.Board(client, function(err){
if (err) {
console.log(err);