Manage the state of JavaScript games using unidirectional data flow.
var createGame = require('gamestate')
var game = createGame(document.body, {
var hypercore = require('hypercore') | |
var net = require('net') | |
var level = require('level') | |
var db = level('./db') | |
var core = hypercore(db) | |
var feed = core.createFeed({ secretKey: Buffer('1e2e3e4e5e6e7e8e1e2e3e4e5e6e7e8e1e2e3e4e5e6e7e8e1e2e3e4e5e6e7e8e') }) | |
feed.on('upload', function (block, data) { | |
console.log('uploaded block', block, data) |
var hypercore = require('hypercore') | |
var swarm = require('discovery-swarm') | |
var level = require('level') | |
var db = level('./db') | |
var core = hypercore(db) | |
var sw = swarm({ | |
dns: { | |
server: [ |
var keyboard = require('controller-keyboard') | |
var gameState = { | |
input: {} | |
} | |
keyboard.subscribe(function (action, active) { | |
// active is the current inputs that are active | |
// this is triggered every time the state of a key has changed | |
// maybe we would do something like this to the game state: |
var diff = require('virtual-dom/diff') | |
var patch = require('virtual-dom/patch') | |
var createElement = require('virtual-dom/create-element') | |
var raf = require('raf') | |
var dataCards = require('data-cards')({ | |
height: window.innerHeight - 100, | |
rowHeight: 200 | |
}) |
The goal: create a more diverse membership. We'll still be able to stay a Code for America brigade.
That will be a much stronger relationship for supporting our local projects & events, and we'll still be able to receive support from Code for America.
function accounts (opts) { | |
this.format = opts.format | |
} | |
accounts.prototype.create = function (req, res, cb) { | |
var self = this | |
parseBody(req, function (err, body) { | |
var body = self.format(body) | |
Flatsheet lets you edit data sets in realtime with your team. If you've used Google Spreadsheets with a library like Tabletop.js to create an ad-hoc mini-CMS, Flatsheet solves that problem more effectively, and is an open-source tool you can host on your own server. Flatsheet integrates with Dat, so you can use Dat to clone any sheet, edit locally, and push changes back to Flatsheet.
Flatsheet recently received a grant from the Knight Prototype Fund, as well as a code sprint grant from OpenNews. You can see a work-in-progress example at http://data.seattle.io