Skip to content

Instantly share code, notes, and snippets.

View grant's full-sized avatar

Grant Timmerman grant

View GitHub Profile
@grant
grant / users.sql
Created February 7, 2013 08:28
Random mock users sql
INSERT INTO `users` (`id`, `first_name`, `last_name`, `password`, `phone_number`) VALUES
(NULL, 'Justin','Brown','OVab1ohthaech','+18284001200'),
(NULL, 'Emma','Abbey','Chae8loo4','+13605684665'),
(NULL, 'Connie','Hatten','rah1ou2Qu','+14144591956'),
(NULL, 'Jesus','Goodwin','Laiph6oo','+18188644418'),
(NULL, 'Ernest','Ruffin','ahY0ijei3h','+19172338187'),
(NULL, 'Laurel','Owen','Oom8yohje','+16155206920'),
(NULL, 'Carol','Stormer','choh2ahF','+13126607383'),
(NULL, 'Annette','Paul','Ieke5yai','+12482553404'),
(NULL, 'Ronda','Stanley','suiD5id7Toh','+15622754365'),
@grant
grant / gist:6276945
Last active December 21, 2015 08:18
Leap Motion Developers around the world
Get coordinates:
http://jsfiddle.net/granttimmerman/MqEQ3/6/embedded/result/
Paste them here:
http://www.darrinward.com/lat-long/
Original data from:
https://developer.leapmotion.com/forums/forums/events-meetups/topics/where-are-you-from
app.get(/^([^.]+)$/, function (req, res) { res.redirect(req.routes.path + '.html');});
@grant
grant / gist:b611edf97235b56665cf
Created May 1, 2014 19:24
Node Modules organization
/node_modules
/package.json
/src
/node_modules
/client -> ../client
/server -> ../server
/shared -> ../shared
/client
/apps
/main
@grant
grant / javascript callbacks
Created May 4, 2014 01:01
javascript callbacks
function test() {
//code
codeThatListensToEvent(function() {
// finish the code
});
}
function codeThatListensToEvent(cb) {
socket.doStuff();
@grant
grant / gist:60544ed82443ff1e678b
Created May 4, 2014 03:04
Fun with javascript
setInterval(function () {
var color = 'rgb('+Math.floor(Math.random()*255)+','+Math.floor(Math.random()*255)+','+Math.floor(Math.random()*255)+')';
console.log(color);
document.getElementsByTagName('header')[0].style['background-color'] = color;
}, 10);
@grant
grant / fonts.md
Last active August 29, 2015 14:02
Favorite fonts
@grant
grant / index.html
Created June 29, 2014 08:01
Rainbow 🌈
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
div {
width: 40px;
height: 10px;
display: inline-block;
@grant
grant / style.css
Created July 13, 2014 23:26
Swift Flatdoc Style
.lang-swift {
color: #528186;
}
.lang-swift .symbol {
color: #000;
}
.lang-swift .keyword {
color: #b6399f;
@grant
grant / index.js
Last active August 29, 2015 14:04
Markov Chain Generator
var numNodes = 20;
var roundNum = 100;
var a = [];
for (var i = 0; i < numNodes; ++i) {
var connections = [];
var sum = 0;
for (var j = 0; j < numNodes; ++j) {
var randNum = Math.random() / numNodes;
// round the num
randNum = Math.round(randNum * roundNum) / roundNum;