This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo add-apt-repository ppa:webupd8team/sublime-text-2 | |
| sudo apt-get update | |
| sudo apt-get install sublime-text-installer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var dust = require('dustjs-linkedin'); | |
| var helpers = require('dustjs-helpers'); | |
| module.exports = { | |
| compile: function(template, options, cb){ | |
| var compiled = dust.compileFn(template); | |
| cb(null, function(context, options, cb){ | |
| compiled(context, cb); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function(chunk, context, bodies, params) { | |
| return chunk.map(function(chunk){ | |
| setImmediate(function(){ | |
| chunk.render(bodies.block, context.push({nome: 'Alan Hoffmeister'})).end(); | |
| }); | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo curl https://dl.dropboxusercontent.com/u/32672522/ngrok -o /usr/bin/ngrok | |
| sudo chmod a+x /usr/bin/ngrok | |
| ngrok 8100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Name: test.txt | |
| Type: file | |
| Path: . | |
| Content-Encoding: utf8 | |
| Hello, I'm a litte test :-) | |
| Name: delete | |
| Type: directory | |
| Path: . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| chat.freenode.net 6667 | |
| morgan.freenode.net 6667 | |
| asimov.freenode.net 6667 | |
| card.freenode.net 6667 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Enviando e-mails usando o Node.js e o famoso nodemailer | |
| var nodemailer = require('nodemailer'); | |
| // Vamos criar a conta que irá mandar os e-mails | |
| var conta = nodemailer.createTransport({ | |
| service: 'Gmail', // Existem outros services, você pode procurar | |
| // na documentação do nodemailer como utilizar | |
| // os outros serviços | |
| auth: { | |
| user: 'seuemail@gmail.com', // Seu usuário no Gmail |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exports.create = function(req, res) { | |
| Thing.create(req.body, function(err, thing) { | |
| if(err) { return handleError(res, err); } | |
| return res.json(201, thing); | |
| }); | |
| console.log(req.body.image); | |
| var thing = new Thing; | |
| var id = gerarUmIDDeAlgumJeito(); | |
| fs.writeFile('upload/' + id, new Buffer(req.body.image, 'base64'), function(err){ | |
| if(err) { return handleError(res, err); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var mongo = require('mongodb'); | |
| var Grid = require('gridfs-stream'); | |
| var Busboy = require('busboy'); | |
| var express = require('express'); | |
| var app = express(); | |
| // Criar uma conexão | |
| var db = new mongo.Db('seuBancoDeDados', new mongo.Server('127.0.0.1', 27017)); | |
| var gfs = Grid(db, mongo); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var commander = require('commander'); | |
| var fs = require('fs'); | |
| var path = require('path'); | |
| var child = require('child_process'); | |
| commander | |
| .version('0.0.1') | |
| .option('-p, --projeto <nome>', 'Cria um projeto') | |
| .option('-d, --deploy', 'Faz o deploy de um projeto') | |
| .parse(process.argv); |