Skip to content

Instantly share code, notes, and snippets.

View zenorocha's full-sized avatar

Zeno Rocha zenorocha

View GitHub Profile
var gulp = require('gulp');
var shell = require('gulp-shell');
gulp.task('init', function() {
return gulp.src('', { read: false })
.pipe(shell('bower install', {
ignoreErrors: true
}));
});
@zenorocha
zenorocha / Prevent default event for links that contains "#"
Created August 5, 2011 13:05
Prevent default event for links that contains "#"
@zenorocha
zenorocha / gist:1150610
Created August 17, 2011 01:37
Nada como um belo trecho de HTML
We couldn’t find that file to show.
@zenorocha
zenorocha / hub.me.md
Created November 22, 2011 11:04
...or the history of my friend Clark Kent

hub.me ...or the history of my friend Clark Kent

image

I love Github, seriously, I really do. Also, my super coder friend Clark Kent loves too.

Some weeks ago, he decided to create a new project on Github called Krypton.

This project is incredible and as the time passed by more and more people started watching and forking it. Awesome!

@zenorocha
zenorocha / hub.me.pt.md
Created November 22, 2011 11:30
...ou a história do meu amigo Clark Kent

hub.me ...ou a história do meu amigo Clark Kent

image

Eu amo o Github, sério, eu amo mesmo. E não sou só eu, meu amigo super desenvolvedor Clark Kent ama também.

Algumas semanas atrás, ele decidiu criar um novo projeto no Github chamado Krypton.

Esse projeto era incrível e à medida que o tempo passava mais e mais pessoas começaram a acompanhar e forkar o projeto. Irado!

@zenorocha
zenorocha / ModulePattern.js
Created June 28, 2012 16:53
JS Module Pattern - GE.com
// definindo um namespace para evitar conflito com outros objetos
window.GLOBOESPORTECOM = window.GLOBOESPORTECOM || {};
GLOBOESPORTECOM.APPS = GLOBOESPORTECOM.APPS || {};
// protegendo o $ do jQuery em uma função anônima,
// prevenindo assim conflitos com outras libs que também usam $
(function($){
@zenorocha
zenorocha / gist:3909630
Created October 18, 2012 02:57
tracking.js - Single Controller Example
var videoCamera = new tracking.VideoCamera().hide().render().renderVideoCanvas();
var t1 = videoCamera.track(
{
type: 'color',
color: 'magenta',
onFound: function(track) {
var pixels = track.pixels;
for (var i = 0, len = pixels.length; i < len; i += 2) {
@zenorocha
zenorocha / gist:4055243
Created November 11, 2012 15:37
tracking.js - Draw Something Example
var videoCamera = new tracking.VideoCamera().hide().render().renderVideoCanvas('#iphoneContainer');
var plotCanvas = new tracking.Canvas().render(),
drawSegments = [],
eraseFound = false,
pencilFound = false,
segment = 0,
selectedElement = document.getElementById('selected');
videoCamera.track({
@zenorocha
zenorocha / gist:4055187
Created November 11, 2012 15:11
tracking.js - Multiple Controller Example
var videoCamera = new tracking.VideoCamera().hide().render().renderVideoCanvas(),
ctx = videoCamera.canvas.context;
var t1 = videoCamera.track({
type: 'color',
color: 'magenta',
onFound: function(track) {
var size = 60 - track.z;
ctx.strokeStyle = "rgb(255,0,255)";
ctx.lineWidth = 3;
@zenorocha
zenorocha / alphabetical-orderded.js
Created November 19, 2012 01:13
alphabetical ordered or not?
AUI().ready('aui-carousel', function(A) {
var carousel = new A.Carousel({
activeIndex: 'rand',
contentBox: '#demo',
intervalTime: 2,
height: 254,
width: 680
}).render();