This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// one-liner to build a sequence of numbers | |
// source: http://ariya.ofilabs.com/2013/01/es6-and-array-comprehension.html | |
Array.apply(0, Array(3)).map(function(x, y) { return y }); // [0, 1, 2] | |
// one-liner to filter elements | |
// source: http://ariya.ofilabs.com/2013/01/es6-and-array-comprehension.html | |
[1,4,2,3,-8].filter(function(i) { return i < 3 }); // [1, 2, -8] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function() { window.onclick = function(e) { window.scroll(0, e.pageY - 20) } })() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git status | grep 'both modified' | awk '{print $4}' | vim -p `tr '\n' ' '` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Noticias</title> | |
</head> | |
<body> | |
<h1>Últimas noticias del día</h1> | |
<h2>Gaza: en medio de la tregua, | |
celebraron un casamiento en una | |
escuela de la ONU</h2> | |
<p>La pareja tenía previsto <a href= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="sidebar"><h2>Sidebar</h2></div> | |
<div class="main"> | |
<h2>Main</h2> | |
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p> | |
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p> | |
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p> | |
</div> | |
<div class="footer"><h2>Footer</h2></div> | |
<div class="header"><h2>He |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="spaceinvader"> | |
<div class="pixel pixel1"> </div> | |
<div class="pixel pixel2"> </div> | |
<div class="pixel pixel3"> </div> | |
<div class="pixel pixel4"> </div> | |
<div class="pixel pixel5-11"> </div> | |
<div class="pixel pixel12-13"> </div> | |
<div class="pixel pixel14-16"> </div> | |
<div class="pixel pixel17-18"> </div> | |
<div class="pixel pixel19-29"> </div> |
OlderNewer