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
@suissa
suissa / exercicio-08-angular-workshop-be-mean
Created August 28, 2014 23:43
Exercício 08 de AngularJs sobre Controllers e Diretivas
<!doctype html>
<html data-ng-app="workshopBeMEAN">
<title>{{ workshop }}</title>
<body>
<div data-ng-controller='BeerController'>
{{ cervejas }}
<pre>Ordenando por predicate = {{predicate}}; reverse = {{reverse}}</pre>
@suissa
suissa / ex09-angularjs-workshop-be-mean
Created August 29, 2014 00:19
Módulos de controllers e função de ordenar no ng-click
<!doctype html>
<html data-ng-app="workshopBeMEAN">
<title>{{ workshop }}</title>
<body>
<div data-ng-controller='BeerController'>
<!-- Exibição do array de cervejas setado no BeerController -->
{{ cervejas }}
<pre>Sorting predicate = {{predicate}}; reverse = {{reverse}}</pre>
@suissa
suissa / ex010-engularjs-workshop-be-mean
Last active August 29, 2015 14:05
Exercício 10 - $http
<!doctype html>
<html data-ng-app="workshopBeMEAN">
<head>
<title>{{ workshop }}</title>
<style>
.user-avatar {
width: 200px;
}
.user-label {
@suissa
suissa / ex010-xxx-angularjs-workshop-be-mean
Created August 29, 2014 00:45
Exercício de Angular consultando a API do Redtub via $http
<!doctype html>
<html data-ng-app="workshopBeMEAN">
<title>{{ workshop }}</title>
<body>
<div data-ng-controller='BeerController'>
<!-- Exibição do array de cervejas setado no BeerController -->
{{ cervejas }}
<pre>Sorting predicate = {{predicate}}; reverse = {{reverse}}</pre>
@suissa
suissa / beerSchema.js
Created September 23, 2014 05:07
Creating models dynamically
var mongoose = require('mongoose');
var BeerSchema = new mongoose.Schema({
id: { type: Number, min: 0},
name: { type: String, default: '' },
description: { type: String, default: '' },
abv: { type: Number, min: 0},
category: { type: String, default: ''},
created_at: { type: Date, default: Date.now },
updated_at: { type: Date, default: Date.now }
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'
},
@suissa
suissa / beeg-bookmarklet.js
Created October 24, 2014 05:33
beeg bookmarklet
javascript:function createLinks(){$(document).ready(function(){$(".hotblock table tbody tr").each(function(e,c){var a=$(c).children("td");$(a).each(function(c,a){var b=$(a).children("img"),d=/\d{7}/.exec(b.attr("data-original"));null!=d&&(b.attr("onClick","javascript:window.open('http://beeg.com/"+d+"')"),b.attr("style","cursor:pointer"))})})})}createLinks();void(0);
@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