Skip to content

Instantly share code, notes, and snippets.

View expalmer's full-sized avatar

Palmer Oliveira expalmer

View GitHub Profile
@expalmer
expalmer / react1.js
Last active August 29, 2015 14:07
React Example
/** @jsx React.DOM */
var Hello = React.createClass({
getInitialState: function() {
return { title: 'Hello World' };
},
render: function() {
return <div><h1>{this.state.title}</h1></div>;
}
@expalmer
expalmer / I18n.js
Created March 4, 2015 13:09
I18n for my react progress form
;(function ( I18n, undefined ) {
var defaultLocale = "en-US";
I18n.locale = defaultLocale;
I18n.translations = [];
I18n.translations["en-US"] = {
name: {
// remove item from array
db.books.update({ '_id': ObjectId("555a412de01a9d4064ed5102")},{ $pull: { "lines": true }}, false, true);
@expalmer
expalmer / Collatz
Created June 3, 2015 16:45
Orientacao a Objetos I
public class Main {
public static void main ( String[] args ) {
int million = 1000000;
int number = 0;
int gt = 0;
int x = 0;
while( --million > 0 ) {
x = collatz( million );
@expalmer
expalmer / locadora
Created June 10, 2015 14:49
Banco de Dados I
INSERT INTO Atores (idAtor, NomeReal, NomeArtistico, DataNascimento) VALUES (1,'Ian Murray McKellen','Ian McKellen', '1939-05-25');
INSERT INTO Atores (idAtor, NomeReal, NomeArtistico, DataNascimento) VALUES (2,'John "Johnny" Christopher Depp II','Johnny Depp', '1963-06-09');
INSERT INTO Atores (idAtor, NomeReal, NomeArtistico, DataNascimento) VALUES (3,'Uma Karuna Thurman','Uma Thurman', '1970-04-29');
INSERT INTO Atores (idAtor, NomeReal, NomeArtistico, DataNascimento) VALUES (4,'Philip Anthony Hopkins','Anthony Hopkins', '1937-12-31');
INSERT INTO Categorias (idCategoria, Nome) VALUES (1,'Action');
INSERT INTO Categorias (idCategoria, Nome) VALUES (2,'Adventure');
INSERT INTO Categorias (idCategoria, Nome) VALUES (3,'Crime');
INSERT INTO Categorias (idCategoria, Nome) VALUES (4,'Drama');
INSERT INTO Categorias (idCategoria, Nome) VALUES (5,'Fantasy');
@expalmer
expalmer / app.js
Last active January 6, 2016 16:22
input e ul
localStorage.test = '';
var stores = new Stores('test');
var datas = [
{ name: 'Eric' },
{ name: 'Jean' },
{ name: 'Pablo' },
{ name: 'Palmer' },
{ name: 'Pepo' }