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
  • Suissa Corp
  • Brasil
View GitHub Profile
@suissa
suissa / app.js
Last active August 29, 2015 14:05 — forked from alanhoff/app.js
var http = require('http');
// Criando o servidor para o proxy
http.Server(function(req, res){
res.writeHead(200, {
'Content-Type' : 'application/json; charset=utf-8',
'Transfer-Encoding' : 'chunked'
});
setInterval(function(){
module.exports = function(app) {
var Schema = require('mongoose').Schema;
var People = Schema({
Name: String,
Address: {
type: Schema.Types.ObjectId,
ref: 'Address'
},
db.timeline.findOne()
{
_id: "username_month_day_hour",
time: [
'59': [ { _idEvent: ObjectId(....), text:'some description text', media:['url'], embedded: "..." } ],
'58': [ { _idEvent: ObjectId(....), text:'some description text', media:['url'], embedded: "..." } ],
'57': [ { _idEvent: ObjectId(....), text:'some description text', media:['url'], embedded: "..." } ],
'56': [ ],
'55': [ { _idEvent: ObjectId(....), text:'some description text', media:['url'], embedded: "..." } ],
'54': [ ],
package main
import (
"fmt"
"strconv"
)
func is_happy_number(number int) bool {
str := strconv.Itoa(number)
@suissa
suissa / class-tests.js
Created April 25, 2012 17:47 — forked from herberthamaral/class-tests.js
Simple, but effective JavaScript class system
describe("class system", function(){
it("should be possible to create classes", function(){
Class({name:'MyClass'});
expect(window.MyClass === undefined).toBeFalsy();
});
it("should be possible to create properties within classes", function(){
Class({
name:'MyClass',
attrs:{
@suissa
suissa / jquery.unbindAll.js
Created April 25, 2012 21:51 — forked from netojoaobatista/jquery.unbindAll.js
Remove todos os manipuladores de eventos que foram anexados aos elementos
/**
* Removes all previously-attached event handlers from the elements.
*/
$.fn.unbindAll = function() {
var events = $(this).data('events');
return this.each( function() {
var $this = $(this);
for ( var evt in events ) {
@suissa
suissa / String.prototype.soundex.js
Created April 25, 2012 21:51 — forked from netojoaobatista/String.prototype.soundex.js
Implementação do algorítimo SoundEX em Javascript
/**
* Implementação do algorítimo SoundEx em Javascript.
* @author João Batista Neto
*
* SoundEX é um algorítimo fonético para indexação de nomes pelo som segundo
* sua pronúncia. O algorítimo foi desenvolvido por Robert C. Russell e
* Margaret K. Odell e patenteado em 1918 e 1922.
* {@link http://en.wikipedia.org/wiki/Soundex}
*
* @return {String}
@suissa
suissa / Proxy.create.js
Created April 25, 2012 21:50 — forked from netojoaobatista/Proxy.create.js
Exemplo simples de uso da API antiga de ECMAScript Proxy
/**
* Um objeto de origem qualquer
*/
var o = { x: 10, y: 10 };
/**
* Criação do Proxy (API antiga).
* Cada uma dessas propriedades do proxy representa uma operação no objeto de origem; O proxy
* receberá a operação e delegará (ou não) para o objeto de origem.
*/
@suissa
suissa / index.html
Created April 27, 2012 12:56
Anything Slider
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>AnythingSlider Video Demo</title>
<link rel="shortcut icon" href="demos/images/favicon.ico">
<link rel="apple-touch-icon" href="demos/images/apple-touch-icon.png">
@suissa
suissa / PaypalRequest.php
Created May 5, 2012 22:25 — forked from diguinhorocks/PaypalRequest.php
PaypalRequest Class (Express Checkout)
<?php
/**
*
* Paypal Request Class.
*
* Classe que adiciona os produtos e cria a requisição para a API Paypal utilizando o Express Checkout.
*
* @author R'Santiago.
* @license http://opensource.org/licenses/gpl-license.php GNU Public License