Skip to content

Instantly share code, notes, and snippets.

View unknowndomain's full-sized avatar
💭
🏳️‍🌈

Tom Lynch unknowndomain

💭
🏳️‍🌈
View GitHub Profile
var output = {};
if ( msg.tweet.text.match(/(love)/i) != null) {
output.increment = 1;
}
if ( msg.tweet.text.match(/(hate)/i) != null ) {
output.decrement = 1;
}
var querystring = require( 'querystring' );
var Buffer = require( 'buffer' ).Buffer;
var request = require( 'request' );
var EVE = {
client_id: null,
client_secret: null,
redirect_url: null,
scope: [],
access_token: null,
@unknowndomain
unknowndomain / name-generator.js
Last active April 15, 2018 15:24
Generates names randomly using common english names.
var num_names = 45;
var firstnames = [
"Amelia","Oliver","Olivia","Jack","Emily",
"Harry","Isla","George","Ava","Jacob",
"Ella","Charlie","Jessica","Noah","Isabella",
"William","Mia","Thomas","Poppy","Oscar",
"Sophie","James","Sophia","Muhammad","Lily",
"Henry","Grace","Alfie","Evie","Leo",
"Scarlett","Joshua","Ruby","Freddie","Chloe",
var PDFDocument = require( 'pdfkit' );
var PDFDocument = require( 'pdfkit' );
var __config = __dirname + '/config/config.json';
var __src = __dirname + '/src';
var __js = __src + '/js';
var config = require( __config ),
db = require( __js + '/database' ).connect( config.mongo );
var Permissions = db.Permissions,
Members = db.Members,
Payments = db.Payments,
@unknowndomain
unknowndomain / mp3-trigger-basic.ino
Last active May 2, 2017 18:25
This is a basic example of playing five short MP3s in a loop.
void setup() {
// Start the serial port at 38.4K
Serial.begin( 38400 );
// Set volume
Serial.print( "v" );
Serial.write( 0 ); // 0 = maximum volume, 255 = minimum volume
}
void loop() {
@unknowndomain
unknowndomain / mpr121-basic.ino
Created May 2, 2017 17:11
Demos how to use the https://github.com/BareConductive/mpr121 library to get touch values and proximity values from each electrode.
#include <MPR121.h>
#include <Wire.h>
#define numElectrodes 12
void setup() {
Serial.begin( 9600 );
Wire.begin();
// Setup MPR121
@unknowndomain
unknowndomain / expo.pde
Last active March 16, 2017 16:28
EXP012 Seperation
PImage redImg, greenImg, blueImg;
PImage createChannel(float r, float g, float b) {
PGraphics pg = createGraphics(200, 200);
pg.beginDraw();
pg.background(0x00);
pg.stroke(r, g, b);
pg.strokeWeight(20);
pg.noFill();
pg.rect(0.5 * pg.width, 0.5 * pg.height, pg.width - 130, pg.height - 180);
@unknowndomain
unknowndomain / neopixel-csv.ino
Created November 25, 2016 12:42
Takes CSV RGB values and outputs to NeoPixels.
#include <Adafruit_NeoPixel.h>
#define PIN 6
Adafruit_NeoPixel strip = Adafruit_NeoPixel( 30, PIN, NEO_GRB + NEO_KHZ800 );
void setup() {
Serial.begin( 9600 );
strip.begin();
strip.show();