This file contains 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 flattenObject = function(ob) { | |
var toReturn = {}; | |
for (var i in ob) { | |
if (!ob.hasOwnProperty(i)) continue; | |
if ((typeof ob[i]) == 'object') { | |
var flatObject = flattenObject(ob[i]); | |
for (var x in flatObject) { | |
if (!flatObject.hasOwnProperty(x)) continue; |
This file contains 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
<!DOCTYPE html> | |
<head> | |
<title>Stay Standalone</title> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | |
<script src="stay_standalone.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<ul> | |
<li><a href="http://google.com/">Remote Link (Google)</a></li> |
This file contains 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 http = require('http'); | |
var server = http.createServer(function(req, res) { | |
// console.log(req); // debug dump the request | |
// If they pass in a basic auth credential it'll be in a header called "Authorization" (note NodeJS lowercases the names of headers in its request object) | |
var auth = req.headers['authorization']; // auth is in base64(username:password) so we need to decode the base64 | |
console.log("Authorization Header is: ", auth); |
This file contains 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
export class EventEmitter<Events, K = keyof Events|symbol> { | |
addListener(event: K, listener: (...args: any[]) => void): this; | |
on(event: K, listener: (...args: any[]) => void): this; | |
once(event: K, listener: (...args: any[]) => void): this; | |
removeListener(event: K, listener: (...args: any[]) => void): this; | |
removeAllListeners(event?: K): this; | |
setMaxListeners(n: number): this; | |
getMaxListeners(): number; | |
listeners(event: K): Function[]; | |
emit(event: K, ...args: any[]): boolean; |
This file contains 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 Perceptron(opts) { | |
if (!opts) opts = {} | |
var debug = 'debug' in opts ? opts.debug : false; | |
var weights = 'weights' in opts | |
? opts.weights.slice() | |
: [] | |
var threshold = 'threshold' in opts |
This file contains 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
chrome | |
https://www.digitalocean.com/community/tutorials/how-to-install-git-on-ubuntu-16-04 | |
https://github.com/creationix/nvm#install-script | |
Instalar com o NVM a versão 6.11.3 do Node | |
http://emberjs.com/ - Instalar a versão 2.18.2. | |
https://github.com/sequelize/cli | |
nodemon | |
bower | |
echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p | |
http://askubuntu.com/questions/765539/how-to-install-postgresql-9-4-on-ubuntu-16-04 |