Skip to content

Instantly share code, notes, and snippets.

David Raviv davidraviv

View GitHub Profile
@nicerobot
nicerobot / jstatd.sh
Created Nov 18, 2011
Run jstatd w/o error 'access denied (java.util.PropertyPermission java.rmi.server.ignoreSubClasses write)'
View jstatd.sh
#!/bin/sh
policy=${HOME}/.jstatd.all.policy
[ -r ${policy} ] || cat >${policy} <<'POLICY'
grant codebase "file:${java.home}/../lib/tools.jar" {
permission java.security.AllPermission;
};
POLICY
jstatd -J-Djava.security.policy=${policy} &
@pheuter
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">
@vmadman
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;
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.');
You can’t perform that action at this time.