Skip to content

Instantly share code, notes, and snippets.

David Raviv davidraviv

Block or report user

Report or block davidraviv

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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">
@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} &
@maicki
maicki / JavaScriptTestingWithGruntMochaAndChai.md
Last active Mar 16, 2019
JavaScript Testing with Grunt, Mocha and Chai
View JavaScriptTestingWithGruntMochaAndChai.md

JavaScript Testing with Grunt, Mocha and Chai

In the following post I would like to introduce one way how you can setup your testing workflow for JavaScript development. The central components in the testing environment are Grunt, Mocha and Chai that I will cover from the introduction and installation of each component to the cooperation of all components for the execution of tests.

If you are already an experienced Grunt user and just look for the Gruntfile.js and the Mocha / Chai setup just skip the central components section and skip to the installing components part.

You can find the sample project with all code at GitHub on: https://github.com/maicki/sample-js-testing-grunt-mocha-chai

Central Components

@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.