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
// 1 - try / catch doesn't work with async codes, so you don't need to use | |
// 2 - You need to add a callback to be trigered when everything had run | |
module.exports = { | |
createNewUser: function (user, callback){ | |
connection.query('INSERT INTO users (email, first_name, last_name, password) VALUES ("'+user.email+'", "'+user.first_name+'", "'+user.last_name+'", "'+user.password+'")' , function(err, result) { | |
// We will pass the error and the result to the function | |
callback(err, result); | |
}); | |
} |
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
Internet | |
| | |
Varnish | |
| | |
nginx | |
| | |
PHP-fpm - PHP-apm | |
| |-------| | |
| Redis | |
MariaDB ----| |
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 express = require('express'); | |
var app = express(); | |
var http = require('http').createServer(app); | |
var io = require('socket.io').listen(http); | |
var irc = require('irc'); | |
var commands = ['up', 'down', 'left', 'right', 'reset']; | |
// Conexão com o IRC do canal | |
var client = new irc.Client('irc.twitch.tv', 'cooplays', { | |
nick: 'cooplays', |
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 meth1 = funciton(){ | |
// Do things here | |
if(gotoMeth2) | |
meth2(); | |
else | |
meth3(); | |
}; | |
var meth2 = function(){ |
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
Vamos iniciar os trabalhos de mais um novo meetup, eis o cronograma para março: | |
09:30 - 10:00 Chegada e recepção dos noders | |
10:00 - 10:30 Apresentação dos palestrantes, formalidades, etc.. | |
10:30 - 11:00 Palestra relâmpago (vaga em aberto) | |
11:00 - 12:00 Palestra principal (vaga em aberto) | |
12:00 - 13:00 Almoço | |
13:00 - 13:30 Palestra relâmpago (vaga em aberto) | |
13:30 - 14:00 Palestra relâmpago (vaga em aberto) | |
14:00 - 14:30 Brainstorm e inscrição para ajudar no portal da comunidade |
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
/* | |
Setup a server, RTC and face tracking | |
Install opencv | |
brew install opencv | |
NPM | |
https://www.npmjs.org/package/fs | |
https://www.npmjs.org/package/http | |
https://www.npmjs.org/package/express | |
https://www.npmjs.org/package/socket.io |
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 net = require('net'); | |
var client = new net.Socket(); | |
client.connect(8080, '192.168.0.1'); | |
client.on('connect', function(){ | |
console.log('Estamos conectados'); | |
// Aqui é o momento ideal para enviar dados; | |
client.write('PCCSMDR'); |
This file has been truncated, but you can view the full file.
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 e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |
/** | |
* @license AngularJS v1.2.11 | |
* (c) 2010-2014 Google, Inc. http://angularjs.org | |
* License: MIT | |
*/ | |
(function(window, angular, undefined) {'use strict'; | |
/** | |
* @ngdoc overview |
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
require('./jquery.js'); | |
require('./angular.js'); | |
require('./angular-route.js'); | |
require('./bootstrap.js'); |
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
{ | |
_id : 'myId', | |
engines : [ | |
{name : 'html5', status : 'ready'}}, | |
{name : 'java', status : 'ready'}}, | |
{name : 'flash', status : 'queued'} | |
] | |
} |