Skip to content

Instantly share code, notes, and snippets.

View drive.js
var five = require('johnny-five');
var keypress = require('keypress');
var board = new five.Board();
board.on('ready', function() {
console.log('Welcome to Sumobot!');
console.log('Control the bot with the arrow keys, and SPACE to stop.');
vmadman / tmpSugarFix.ts
Created Dec 19, 2013
This is *my* current temporary fix to get SugarJS's static method additions working in typescript.
View tmpSugarFix.ts
/// <reference path="../path/to/sugar.d.ts" />
* Usage Examples:
* sgObject.isArray([1]); // -> true
declare var sgObject:ObjectStatic;
declare var sgNumber:NumberStatic;
declare var sgDate:DateStatic;
pheuter / gist:3515945
Created Aug 29, 2012
Handlebars.js equality check in #if conditional
View gist:3515945

Handlebars.js is a template framework for Javascript environments. It allows the construction of HTML elements using HTML and expressions wrapped in {{ }}

Limitations of {{if}}

One of the conditional block helpers Handlebars offers is the {{#if}}.

For example:

<div class="entry">
nicerobot /
Created Nov 18, 2011
Run jstatd w/o error 'access denied (java.util.PropertyPermission java.rmi.server.ignoreSubClasses write)'
[ -r ${policy} ] || cat >${policy} <<'POLICY'
grant codebase "file:${java.home}/../lib/tools.jar" {
jstatd${policy} &