Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Glauber Ramos glauberramos

🏠
Working from home
Block or report user

Report or block glauberramos

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
@glauberramos
glauberramos / doors.js
Created May 30, 2012
3 Doors (One with a reward) problem
View doors.js
var doors = [false, false ,true];
var didntChangeDoorCount = 0;
var changedDoorCount = 0;
for(i=0;i<10000;i++) {
var picker = Math.floor(Math.random()*3);
//dont change
if(doors[picker]) didntChangeDoorCount++;
@glauberramos
glauberramos / bad.js
Created Jul 11, 2012
Bad javascript code - Example for blog post
View bad.js
//this function represents a book from an online library
//it has 3 methods to search the book, remove a specific word and change it
//it has 4 attributes, name, author, date and content
//creates libaries stuffz
function elementliBRaryContent(a,b,c,d) {
var bnam = a;var baut = b;
var bdat = c;
var bcont = d;
var self = { findword: function(x) { return bcont.indexOf(x)>=0;},
@glauberramos
glauberramos / bad.js
Created Jul 19, 2012
Bad javascript code - Example for blog post - Identation
View bad.js
//this function represents a book from an online library
//it has 3 methods to search the book, remove a specific word and change it
//it has 4 attributes, name, author, date and content
//creates libaries stuffz
function elementliBRaryContent(a,b,c,d) {
var bnam = a;
var baut = b;
var bdat = c;
var bcont = d;
@glauberramos
glauberramos / bad.js
Created Jul 19, 2012
Bad javascript code - Example for blog post - Meanful and Concise Variables/Methods Names
View bad.js
//this function represents a book from an online library
//it has 3 methods to search the book, remove a specific word and change it
//it has 4 attributes, name, author, date and content
//creates libaries stuffz
function book(name,author,content,date) {
var name = name;
var author = author;
var content = content;
var date = date;
@glauberramos
glauberramos / bad.js
Created Jul 19, 2012
Bad javascript code - Example for blog post - Concise Comments
View bad.js
function book(name,author,content,date) {
var name = name;
var author = author;
var content = content;
var date = date;
var self = {
findWord: function(word) {
return content.indexOf(word)>=0;
},
@glauberramos
glauberramos / bad.js
Created Jul 19, 2012
Bad javascript code - Example for blog post - White Spaces
View bad.js
function book(name, author, content, date) {
var name = name;
var author = author;
var content = content;
var date = date;
var self = {
findWord: function(word) {
return content.indexOf(word) >= 0;
},
@glauberramos
glauberramos / bad.js
Created Jul 19, 2012
Bad javascript code - Example for blog post - DRY
View bad.js
function book(name, author, content, date) {
var name = name;
var author = author;
var content = content;
var date = date;
var self = {
containsWord: function(word) {
return content.indexOf(word) >= 0;
},
@glauberramos
glauberramos / bad.js
Created Jul 19, 2012
Bad javascript code - Example for blog post - Remove Unuseful Code
View bad.js
function book(name, author, content, date) {
var name = name,
author = author,
content = content,
date = date;
var self = {
containsWord: function(word) {
return content.indexOf(word) >= 0;
},
View FrontCalendar 2012.md

FrontCalendar 2012

Na falta de um site decente e realmente atualizado com os eventos de front-end que vão rolar, dê um pulo aqui ;)

Vai rolar!

Tableless Conference

  • Quando: 24/08
  • Onde: São Paulo, SP
  • Preço: R$ 250,00
@glauberramos
glauberramos / gist:3641107
Created Sep 5, 2012
Javascript Closure Example
View gist:3641107
var a = function() {
var b = 0;
return function() {
b = b + 1;
return b;
};
};
var d = a();
You can’t perform that action at this time.