This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
style | |
* { | |
box-sizing: border-box; | |
} | |
body { | |
margin: 0 0; | |
padding: 0; | |
background-color: #eee; | |
text-align: center; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
player = false | |
inGame = false | |
me = undefined | |
dead = undefined | |
gameID = window.location.hash.slice 1 | |
socket = io.connect 'http://localhost' | |
# PLAYER EVENTS | |
kill = (target) -> | |
if inGame and player and not dead then socket.emit 'kill', target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app = require('http').createServer(handler) | |
io = require('socket.io').listen(app) | |
fs = require('fs') | |
app.listen 80 | |
handler = () -> | |
fs.readFile __dirname + '/index.html', (err, data) -> | |
if err | |
res.writeHead 500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# required in process.env: host, cloudant_account, cloudant_key, cloudant_pass, | |
# cloudant_db_accounts, cloudant_db_data, cookie_secret, redis_url, redis_port, redis_path, | |
# smtp_email, smtp_pass, smtp_host, smtp_ssl | |
bodyParser = require 'body-parser' | |
cloudant = require 'cloudant' account: process.env.cloudant_account, | |
key: process.env.cloudant_key, | |
password: process.env.cloudant_pass | |
email = require 'email' | |
express = require 'express' () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DATA | |
## USER | |
email KEY string | |
name string | |
elevated boolean | |
auth string -> USER.email | |
key string | |
expires date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
REDIS SCHEMA | |
------------ | |
SET @domain.al@email key | |
STRING @domain.ae@email token | |
HASH @domain.as@key A acl, S secret | |
HASH @domain.u@email N name, A acl, [T trustee], [X delete] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module cpu; | |
reg [7:0] ax, bx, ix, pc; | |
reg [3:0] ir; | |
reg [7:0] mem [0:255]; | |
// reset | |
initial begin | |
ax <= 0; | |
bx <= 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mastermind { | |
constructor() { | |
this.length = 4 | |
this.chars = ['0', '1', '2', '3', '4', '5'] | |
} | |
generate() { | |
this.key = [] | |
for (var i = 0; i < this.length; i++) | |
this.key.push(this.chars[(Math.random() * this.chars.length) | 0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// process.env: {...keys, FB_PAGE_ACCESS_TOKEN, VERIFY_TOKEN} | |
// Requires DynamoDB | |
// Setup: Copy to clean directory, `npm install aws-sdk request`, zip & upload to Lambda. | |
'use strict' | |
const request = require('request') | |
const AWS = require('aws-sdk') | |
const docClient = new AWS.DynamoDB.DocumentClient() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
filetype off | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'VundleVim/Vundle.vim' | |
Plugin 'vim-airline/vim-airline' | |
Plugin 'edkolev/promptline.vim' | |
Plugin 'sjl/gundo.vim' |