Skip to content

Instantly share code, notes, and snippets.

it('it knows when players should select categories and set questions', function() {
var g = new Game();
g.setupTwoPlayerGame(player1, player2);
assert.equal(true, g.canSetRoundQuestions(player1.id), 'canSetRoundQuestions P1 should return true');
assert.equal(false, g.canSetRoundQuestions(player2.id), 'canSetRoundQuestions P2 should return false');
g.setRoundQuestions(player1.id, 'x', 'y', [{ id:1, text:'question 1', alternatives: [] }]);
assert.equal(false, g.canSetRoundQuestions(player1.id));
assert.equal(false, g.canSetRoundQuestions(player2.id));
<html><body><style> div#anim1 b { display: inline-block; width: 1px; height: 1px; } @-webkit-keyframes p340 { 0%% { background: rgb(0,0,0); } 4.714285714285714%% { background: rgb(0,0,0); } 9.428571428571429%% { background: rgb(0,0,0); } 14.142857142857142%% { background: rgb(8,16,8); } 18.857142857142858%% { background: rgb(0,0,0); } 23.571428571428573%% { background: rgb(0,0,0); } 28.285714285714285%% { background: rgb(0,0,0); } 33%% { background: rgb(0,0,0); } 37.714285714285715%% { background: rgb(0,0,0); } 42.42857142857143%% { background: rgb(0,0,0); } 47.142857142857146%% { background: rgb(0,0,0); } 51.857142857142854%% { background: rgb(0,0,0); } 56.57142857142857%% { background: rgb(0,0,0); } 61.285714285714285%% { background: rgb(0,0,0); } 66%% { background: rgb(0,0,0); } 70.71428571428571%% { background: rgb(0,0,0); } 75.42857142857143%% { background: rgb(0,0,0); } 80.14285714285714%% { background: rgb(0,0,0); } 84.85714285714286%% { background: rgb(0,0,0); } 89.57142857142857%% { background: rgb(0
@possan
possan / stick.ino
Created September 9, 2014 21:31
Simple arcade stick controller thingy for Arduino, emulating an keyboard, sending arrow key events
const int leftButton = 4;
const int rightButton = 5;
const int upButton = 6;
const int downButton = 3;
const int enterButton = 7;
const int ledPin = 12;
class Debouncer {
private:
int time;
@possan
possan / ledpanel.js
Created September 10, 2014 22:22
64x32 ledpanel driver for node.js
var SerialPort = require("serialport");
// https://github.com/tompreston/4x5-Font/blob/master/4x5-font.js
var font4x5 = {
'': [0x0, 0x0, 0x0, 0x0, 0x0],
'!': [0x4, 0x4, 0x4, 0x0, 0x4],
'#': [0x6, 0xf, 0x6, 0xf, 0x6],
'\'': [0x0, 0xa, 0x0, 0x0, 0x0],
'%': [0x7, 0xe, 0x4, 0x7, 0xe],
'$': [0x7, 0xa, 0x6, 0x5, 0xe],
@possan
possan / ledpanel.ino
Created September 10, 2014 22:22
64x32 ledpanel driver
// PINS
// OE A
// - B
// - -
// - CLK
// - SCLK
// - -
// - R
// - -
var SerialPort = require("serialport");
var moment = require('moment');
// https://github.com/tompreston/4x5-Font/blob/master/4x5-font.js
var font4x5 = {
'': [0x0, 0x0, 0x0, 0x0, 0x0],
'!': [0x4, 0x4, 0x4, 0x0, 0x4],
'#': [0x6, 0xf, 0x6, 0xf, 0x6],
'\'': [0x0, 0xa, 0x0, 0x0, 0x0],
'%': [0x7, 0xe, 0x4, 0x7, 0xe],
@possan
possan / gltest.m
Last active August 29, 2015 14:16
Minimal self container OpenGL Example on OSX
//
// Minimal self container OpenGL Example
//
// Compile with:
// xcrun gcc -o test -framework Foundation -framework OpenGL -framework CoreGraphics -framework AppKit main.m
//
#import <Foundation/Foundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import <OpenGL/OpenGL.h>
@possan
possan / gltest.m
Created February 25, 2015 22:06
Minimal OpenGL Shader example
//
// Minimal self container OpenGL Example
//
// Compile with:
// xcrun gcc -o test -framework Foundation -framework OpenGL -framework CoreGraphics -framework AppKit main.m
//
#import <Foundation/Foundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import <OpenGL/OpenGL.h>
@possan
possan / dotstardisk-clcok.ino
Created September 3, 2015 21:40
A simple clock for the dotstar disk by adafruit https://www.adafruit.com/products/2477
#include <EEPROM.h>
#include <Adafruit_DotStar.h>
#include <SPI.h>
#include "TimerThree.h"
// R0 = 4x12 leds
// R1 = 4x11 leds
// R2 = 4x10 leds
// R3 = 4x9 leds
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="...." Inherits="...." %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<asp:ContentPlaceHolder ID="HeadContent" runat="server" />
<asp:Literal ID="liHeaders" runat="server" EnableViewState="false" />
</head>
<body class="standard yui-skin-sam">