Skip to content

Instantly share code, notes, and snippets.

View gusaaaaa's full-sized avatar

Gusa gusaaaaa

  • Montevideo, Uruguay
View GitHub Profile
@gusaaaaa
gusaaaaa / gerbil-api-proposal.js
Created April 24, 2013 20:40
Gerbil new API proposal including support for promises (Promises/A+)
if(typeof module != "undefined")
var scenario = require("../lib/gerbil.js").scenario;
scenario("Gerbil - Assertions", {
"should be able to assert": function(g) {
g.assert(true, true);
g.assert(true); // g.assert(x, x) is equivalent to g.assert(x)
g.assert(1 == 1);
g.assert(true != false);
},
@gusaaaaa
gusaaaaa / promise-thenseq.js
Last active December 16, 2015 14:19
Generates a sequence of thens
// Requires https://github.com/tildeio/rsvp.js
// Once in a blue moon we need to concatenate several thens executing basically the same code.
// Example:
// f().then(function(message) {
// alert(message + " #1");
// return f();
// }).then(function(message) {
// alert(message + " #2");
// return f();
@gusaaaaa
gusaaaaa / bshtml5
Last active December 16, 2015 12:59
Bootstraps an empty HTML5 structure
# Outputs an empty HTML5 structure.
# Usage:
# emptyhtml5 [--with-script] [--with-style]
while [ $# -ne 0 ]
do
if [[ "$1" == "--with-script" ]]; then
script="
<script src=\"[youscript.js]\"></script>"
elif [[ "$1" == "--with-style" ]]; then