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 / breakpoints-media-query
Created August 15, 2014 04:11
Breakpoints for media query with EM
// Breakpoints
// Base: 16px
// Small: 688px - 43em
// Tablets: 768px - 48em
// Desktop: 1024px - 64em
// Large Screen 1: 1440px - 90em
// Large Screen 2: 1600px - 100em
@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(){
@suissa
suissa / method-override-http-verbs
Created August 28, 2014 01:40
Using _method input hidden to override HTTP verbs
var methodOverride = require('method-override')
// NOTE: when using req.body, you must fully parse the request body
// before you call methodOverride() in your middleware stack,
// otherwise req.body will not be populated.
app.use(methodOverride(function(req, res){
if (req.body && typeof req.body === 'object' && '_method' in req.body) {
// look in urlencoded POST bodies and delete it
var method = req.body._method
@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>
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);