Skip to content

Instantly share code, notes, and snippets.

View suissa's full-sized avatar
🏠
Working from home

Jean Carlo Nascimento suissa

🏠
Working from home
  • Oncorithms Institute
  • Brasil
View GitHub Profile
@alganet
alganet / developerquiz.php
Created August 8, 2011 20:28
Full script for the Google Developer Day Quiz (http://developerquiz.appspot.com) in 39 lines
<?php //Run as command line. Input file as first argument.
const G_FOO = 'aeiou'; //Googlon special letters
const G_INV = 'z'; //Preposition invalidator
const G_PREP = 3; //Preposition size
const G_VERB = 8; //Verb size
const G_ORDER = 'qnbczxjtklmvhrwfsdgp'; //Letter ordering
const G_NUM_MOD = 4; //Pretty number divisor
const G_NUM_MAX = 526593; //Pretty number minimum
$textB = explode(' ', file_get_contents($argv[1]));
@hastebrot
hastebrot / mongoose.dbref.example.js
Created August 25, 2011 15:20
Example of DBRef support in Mongoose 2.0
var mongoose = require("mongoose");
var Schema = mongoose.Schema;
mongoose.connect("127.0.0.1", "mongoose_dbref", 27017);
var PersonSchema = new Schema({
name : String
, age : Number
, stories : [{ type: Schema.ObjectId, ref: 'Story' }]
});
var StorySchema = new Schema({
@artero
artero / launch_sublime_from_terminal.markdown
Last active July 26, 2025 16:28 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@leobalter
leobalter / gist:1243947
Created September 27, 2011 00:56
Javascript vai dominar o mundo

Proposta de palestra

Autor:

Leonardo Balter

Sobre:

Evangelista de tecnologias FrontEnd, foco em Javascript (Node.Js e browser apps).

@danielfilho
danielfilho / jsconf-eu-2011.md
Created October 11, 2011 20:52 — forked from mattpodwysocki/jsconf-eu-2011.md
JSConf.EU Slides
@paulirish
paulirish / data-markdown.user.js
Last active June 27, 2025 05:29
*[data-markdown] - use markdown, sometimes, in your HTML
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.
@leobalter
leobalter / gist:1358053
Created November 11, 2011 13:55
Escrever Ruby de uma forma melhor, com tipagem ou código mais bonito!

Original em: http://leobalter.net/cases/escrever-ruby-de-uma-forma-melhor-com-tipagem-ou-codigo-mais-bonito/

Escrever Ruby de uma forma melhor, com tipagem ou código mais bonito!

Depois das ideias super bacanas que a comunidade Ruby trouxe, de fomentar o CoffeScript para escrever um “JavaScript” mais bonito, ou da Google de fazer o Dart para escrever um JavaScript “tipado”, resolvi também trabalhar em algo que deixaria o Ruby perfeito.

Puby e Juby! São dois projetos distintos mas com propósitos excelentes:

Puby

@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!

@dhotson
dhotson / oo.php
Created December 6, 2011 12:02
PHP Object Oriented Programming Reinvented (for PHP 5.4)
<?php
// Define the 'class' class
$class = (new Obj)
->fn('new', function() {
$newClass = (new Obj($this->methods))
->fn('new', function() {
$obj = new Obj($this->imethods);
call_user_func_array(array($obj, 'init'), func_get_args());
return $obj;
@herberthamaral
herberthamaral / gist:1607387
Created January 13, 2012 16:37
storage_flood
// função pra floodar o localStorage, com o intuito de saber se o browser simplesmesnte lança uma
// exception quando o storage está cheio ou se o browser pergunta se o user deseja expandir o
// espaço disponível para o localStorage
function flood(){
for(i=0;i<5*1024*1024;i++) {
window.localStorage.setItem(Math.random().toString(), Math.random().toString())
}
}