Skip to content

Instantly share code, notes, and snippets.

View leobalter's full-sized avatar
💭
status

Leo Balter leobalter

💭
status
  • GitHub Staff
  • Bay Area, CA
View GitHub Profile
QUnit.suite('jQuery Core', function (assert, test) {
test.beforeEach(function (assert) {
var env = this,
done = assert.async();
this.user = 'data';
setTimeout(function () {
env.foo = 'bar';
- Ed Wood
- Starship Troopers
- Doctor Who's blink episode
- Some Monty Python movie (Holy Grail, The Meaning of Life, Life of Brian)
@leobalter
leobalter / pave.md
Last active August 29, 2015 14:05 — forked from juanplopes/pave.md

Texto criado pelo amigo Carlos Krämer (github . twitter . facebook) lá no Facebook, reproduzido aqui com a permissão dele.

Jornalista: Candidato, é pavê ou pra comê?

Dilma: Veja bem, nunca foi tanto pra comê quanto no meu governo. Há um ditado.... eu digo, editaram quando eu era o cachorro atrás de uma criança ... que diz que todo mundo que insere, ou melhor, ingere o que é pavê, tem uma satisfação imensa de... como dizem... dobrar a esquina. Mas nós precisamos continuar mudando, meu governo foi ótimo, eu fui eleita para dar prosseguimento ao governo Lula, Lula, LULA. Mas ninguém está mais insatisfeita com ele, digo, com o governo, não com o Lula, do que eu, mas os pessimistas é que estão tornando tudo ruim.

Marina: Eu não acho que é pavê nem pra comê. Nós precisamos aprender a reunir o que é bom em tudo, as melhores

(function() {
/*globals console */
if ( !console || typeof console.log !== "function" ) {
return;
}
var assertionCount = 0,
failed = [];

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@leobalter
leobalter / rmr-qunit.js
Created May 26, 2014 02:15
rocambole-method-rename script for QUnit
var rmr = require( "rocambole-method-rename" );
var methods = [
{ old: "start", next: "QUnit.start" },
{ old: "stop", next: "QUnit.stop" },
{ old: "test", next: "QUnit.test" },
{ old: "module", next: "QUnit.module" },
{ old: "asyncTest", next: "QUnit.asyncTest" },
{ old: "ok", next: "assert.ok" },
{ old: "equal", next: "assert.equal" },
var reporterInterface = (function() {
function start( data ) {
/** PROCESS DATA **/
output( "TAP version 13" );
}
function suiteStart( data ) {
/** PROCESS DATA **/
var resp = comment( data.name + " suite" );

Having esformatter installed - TL;DR: npm install -g esformatter - insert these lines to your ~/.vimrc file.

tjs is the shortcut to execute esformatter on your file.

nnoremap <silent> tjs :%!esformatter <Enter>
vnoremap <silent> tjs :!esformatter <Enter>

TODO: filter the command to run only on .js files.

// JavaScript Document
var browserName=navigator.appName;
if (browserName=="Netscape")
{
}
else
{
if (browserName=="Microsoft Internet Explorer")
{
<html>
<head>
<script type="text/javascript">
setTimeout(function () {
window.custom_$ = {};
}, 2000);
</script>
</head>
<body>
</body>