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 / app-method-override.js
Last active September 11, 2015 00:33
Exemplo de como usar o method-override para enviar um FORM com POSt e ele mudar para PUT
var methodOverride = require('method-override');
// Method Override
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
delete req.body._method
return method
}
}));
@suissa
suissa / dargNdrop.html
Created October 10, 2015 11:51
dargNdrop com html5
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Darg and drop</title>
<style type="text/css">
li {
list-style: none;
}
@suissa
suissa / camera.html
Created October 10, 2015 13:16
Uso da camera com HTML5
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<title>Videochat, step 1</title>
</head>
<body>
<video id="video" width="640" height="480" autoplay></video>
<button id="snap">Snap Photo</button>
@suissa
suissa / mathml.html
Created October 10, 2015 13:39
MathML
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>MathML</title>
</head>
<body>
<math>
<mrow>
<mi>x</mi>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>SVG</title>
</head>
<body>
<svg width="400" height="400">
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Canvas API</title>
</head>
<body>
<canvas id="x" width="300" height="300"></canvas>
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8" />
<title>Notifier</title>
<script>
function notify(text){
document.getElementById('msg').innerHTML+='<p>'+text+'</p>'
@suissa
suissa / app.js
Created October 31, 2015 13:36
App de rotas com mongoose - fase inicial
var http = require("http");
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/bemean-cascavel');
var db = mongoose.connection;
db.on('error', function(err){
console.log('Erro de conexao.', err)
});
db.on('open', function () {
@suissa
suissa / ex010.html
Created November 1, 2015 14:07
Exercício 10
<!doctype html>
<html data-ng-app="workshopBeMEAN">
<head>
<title>{{ workshop }}</title>
<style>
.user-avatar {
width: 200px;
}
.user-label {
@suissa
suissa / service.js
Created November 1, 2015 15:46
Service do modulo de Beers
(function(){
'use strict';
angular.module('BeerServiceModule', [])
.service('BeerService', BeerService)
;
function BeerService($http) {
var urlBase = '//localhost:3000/beers';