Skip to content

Instantly share code, notes, and snippets.

View olizilla's full-sized avatar

Oli Evans olizilla

View GitHub Profile
@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.
*/
@olizilla
olizilla / meteor-dump.sh
Last active May 29, 2016 02:18
Dump a mongo db from a live meteor app to a local dump dir.
#!/bin/bash
# __
# _____ ____ _/ |_ ____ ____ _______
# / \ _/ __ \ \ __\_/ __ \ / _ \ \_ __ \
# | Y Y \\ ___/ | | \ ___/ ( <_> ) | | \/
# |__|_| / \___ > |__| \___ > \____/ |__|
# \/ \/ \/
#
# .___
# __| _/ __ __ _____ ______
@olizilla
olizilla / README.md
Last active January 10, 2016 19:52
Notes from SquatConf 2014. Typed quickly, all concepts may be corrupted, but the gist is there.

Notes From SquatConf 2014

@dhigit9 - UDT: an application leyer TCP you can tune.

Replace TCP, application layer comm framework.

instantwebp2p - node fork that supports UDT. congestion control - optimal usage of bandwidth flow control - avoid overwhelming the receiver. window based - no packets in flight

#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:

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

img {
width:200px;
opacity:0;
position:absolute;
top:0;
z-index:1;
}
body{
margin:0;
}
@olizilla
olizilla / bluffers-guide-to-nodebots.md
Last active December 21, 2015 20:59
A bluffers guide to NodeBots, Arduino, and Hardware
@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 / 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;

Meteor London July 2013

  • Chris Waring - THIS IS METEOR!
  • Shane - Meteor Gantt.
  • Paul Harwood - http://storyapp.it
  • Rob Miller - Noise Network - A real-time noise monitoring solution.
  • Alan Shaw - nodeconf & asciify
  • Oli - Is drone down for everyone or just me?
  • Jon - Real world buttons