Skip to content

Instantly share code, notes, and snippets.

View olizilla's full-sized avatar

Oli Evans olizilla

View GitHub Profile
@olizilla
olizilla / easy-motor.ino
Last active December 20, 2015 10:20
Using the Adafruit motor shield to power chunky motors. If you don't get enough grunt from the motor *do not just run 2A through it*. Smoking occurs. see: http://learn.adafruit.com/adafruit-motor-shield
#include <AFMotor.h>
/*
Graccefully spin up, run, spin down and reverse a motor
*/
AF_DCMotor motor(2, MOTOR12_64KHZ); // create motor #2, 64KHz pwm
// FORWARD = 1, BACKEWARD = 2, RELEASE = 4
const int UP = 1;
@olizilla
olizilla / how-to-build-an-awesome.md
Last active December 20, 2015 11:49
Notes on tracking ships. IN THE FUTURE.

How I'd build an awesome thing, if I were me, today.

  • Realtimey push of async events to all clients - We track ships. Ships move. The client should be informed of each position report, as they happen. I strongly believe that this should be at the core of all our apps. This expands to a generic async event notification system. Consider WebSockets via Engine IO or push as a service via http://pusher.com
  • DOM templates. This isn't just a bunch of strings dammit, it's chunks of HTML. The templates should be HTML too.
  • Client side DB. Structured APIs over localStorage & indexDB are sufficiently advanced that we can sync subsets of the server data with a client side DB-like structure. User interactions manipulate the local data, and just those diffs are communicated to the server. If the client maliciously force-violates the front-end validators, then the server simply rejects the change, and sends back the relevant diff to patch their database state
@olizilla
olizilla / bluffers-guide-to-nodebots.md
Last active December 21, 2015 20:59
A bluffers guide to NodeBots, Arduino, and Hardware
img {
width:200px;
opacity:0;
position:absolute;
top:0;
z-index:1;
}
body{
margin:0;
}

Meteor London News

Some new news & some old news that we just learnt about the hard way

  • Meteor UI

  • Meteor Roadmap to 1.0

  • Meteor dependency updates:

  • Node release 0.10

#include <Servo.h>
Servo servo;
int servoPin = 9;
int rotationSpeed = 1250;
// Oi! Jamie! You may need to noodle the value of `rotationSpeed`
// As far as I can tell, it means:
head
68 x 36.5 cm
eyes
12cm diameter
- 13cm in from left x 9.5 down from top.
neck 1
47 x 4.7cm
@olizilla
olizilla / lxjs-and-you.md
Last active August 29, 2015 14:02
LXJS is made with <3.

LXJS and DRIIFT

It's often said:

"LXJS is made with love".

It's true. Love, and a huge amount of work.

Lot's of awesome happens at LXJS.

html,body,#objects {
width: 100%; height: 100%
}
body{
background:white;
}
@olizilla
olizilla / meteor-account-verify.js
Created August 19, 2014 10:41
Only allow users on a given email domain to log in to your meteor app.
/*
Only allow users with a verified email address on a pre-verified domain to log in.
We're getting people to authenticate and only authorising those that have an email we recognise.
Assumes a Meteor.settings like:
{ adminDomains: ['tableflip.io', 'meteor.com'] }
...and meteor-developer accounts, but other login mechanisms (email, twitter) would work too.
*/