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 / comma-first-por-que-usar.md
Created December 13, 2014 14:38
comma-first por que usar?

{<10>} Bom se você acompanha meus códigos já deve ter pego algo assim:

var mongoose = require('mongoose')
  , Schema = mongoose.Schema
  , ClassSchema = { title: { type: String, default: '' }
    , description: { type: String, default: '' }
    , video: { type: String, default: '' }
 , content: { type: String, default: '' }
@suissa
suissa / conditional-overload-stylus
Last active August 29, 2015 14:11
Resposta para uma pergunta no grupo de Stylus no Facebook
font-size()
font-size: arguments
h1-title(z = 12px)
width 100%
float left
font-size z
font-weight 100
margin 0
.title
@suissa
suissa / linhaDoTempoSchemaExemploRuim
Created January 28, 2015 19:00
linhaDoTempoSchemaExemploRuim
{hora: [
0: [{
tipo: {type: String, default: ''}
, idPublicacao: Schema.Types.ObjectId
}]
, 1: [{
tipo: {type: String, default: ''}
, idPublicacao: Schema.Types.ObjectId
}]
, 2: [{
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': [ ],
@suissa
suissa / user-settings-sublime.json
Created April 30, 2015 14:03
user-settings-sublime.json
{
"color_scheme": "Packages/Theme - Spacegray/base16-eighties.dark.tmTheme",
"font_size": 16,
"ignored_packages":
[
"Vintage",
"BracketHighlighter",
"Markdown"
],
"tab_size": 2,
var Beer = require('./model')
, Cervejaria = require('./model-cervejaria')
;
Cervejaria
.findOne()
.populate('beers')
.exec(function (err, cervejaria) {
if (err) return console.log('Erro: ', err);
console.log('Cervejaria', cervejaria);
package main
import (
"fmt"
"strconv"
)
func is_happy_number(number int) bool {
str := strconv.Itoa(number)
@suissa
suissa / exe01.js
Last active August 29, 2015 14:22
Workshop Geoloc com MongoDb - Exercicios
var MongoClient = require('mongodb').MongoClient
, url = 'mongodb://localhost:27017/geodb'
, lugar = {
name: "Zona da Creide"
, loc: [50, 50]
}
;
MongoClient.connect(url, function(err, db) {
if(err) return console.log(err);
@suissa
suissa / routes-api.js
Created June 3, 2015 22:45
Meu arquivo que gera rotas automaticamente para o Express a partir de um JSON
var express = require('express')
, router = express.Router()
, Controller = require('./../controller')
;
var cbCreate = function(req, res) {
Controller.create(req, res);
}
, cbRetrieve = function(req, res) {
Controller.retrieve(req, res);
@suissa
suissa / jsfuncional-high-order-functions-example-01.js
Created September 4, 2015 02:13
Examples of high order functions in JavaScript #01
function somar(x, y) {
return x + y;
};
function subtrair(x, y) {
return x - y;
};
function multiplicar(x, y) {
return x * y;