Skip to content

Instantly share code, notes, and snippets.

View ehgoodenough's full-sized avatar

Andrew Goodenough ehgoodenough

View GitHub Profile
var Electron = require("electron")
var window = null
Electron.app.on("ready", function() {
window = new Electron.BrowserWindow({width: 800, height: 600})
window.loadURL("file://" + __dirname + "/source/index.html")
window.webContents.openDevTools({mode: "bottom"})
window.on("closed", function() {

Building

Installation

Do you have node?

$ node --version
v6.x.x
var Pixi = require("pixi.js")
var Afloop = require("afloop")
var Keyb = require("keyb")
var WIDTH = 230
var HEIGHT = 130
var STAR_COUNT = 30
var renderer = Pixi.autoDetectRenderer(WIDTH, HEIGHT)
renderer.backgroundColor = 0x222222
var Pixi = require("pixi.js")
var Afloop = require("afloop")
var Keyb = require("keyb")
var WIDTH = 230, HEIGHT = 130
var renderer = Pixi.autoDetectRenderer(WIDTH, HEIGHT)
renderer.backgroundColor = 0x0F380F
renderer.roundPixels = true
var Firebase = require("firebase")
class Leaderboard {
constructor(firebaseURL) {
this.firebase = new Firebase(firebaseURL)
this.firebase.orderByChild("score").limitToLast(5).on("value", (value) => {
this.scores = value.val()
})
}
add(data) {
if(Meteor.isServer) {
Meteor.startup(function() {
SyncedCron.add({
name: "Send an email",
schedule: function(later) {
return later.text("at 12:15 pm")
},
job: function() {
HTTP.get("http://moreofmymusic.tumblr.com/rss", function(error, data) {
xml2js.parseString(data.content, function(error, data) {
curl -d'{"copyright": "Andrew McPherson", "url": "ehgoodenough.com", "email": "[email protected]", "gravatar": true }' http://.mit-license.org
var generateURL = function(target, params) {
if(typeof target != "string") {
target = target.join("/")
}
if(typeof params != "string") {
params = Object.keys(params).map(function(key) {
return key + "=" + params[key]
}).join("&")
}
return target + "?" + params
@ehgoodenough
ehgoodenough / .gitignore
Last active August 29, 2015 14:22
This is our example server for streaming data from the tablet to the database.
node_modules
var Loop = function(func) {
(function loop(time) {
func(Math.min((Date.now() - time) / 1000, 1))
window.requestAnimationFrame(loop.bind(null, Date.now()))
})(Date.now())
}
module.exports = Loop