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
| Math.random = (function(rand){ | |
| var salt = 0; | |
| document.addEventListener("mousemove", function(event){ | |
| salt = event.pageX * event.pageY; | |
| }); | |
| return function(){ return (rand() + (1 / (1 + salt))) % 1; }; | |
| })(Math.random); |
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 yum upgrade -y | |
| sudo yum install -y gcc-c++ | |
| sudo yum install -y openssl-devel | |
| sudo yum install -y make | |
| sudo yum install -y git | |
| wget http://nodejs.org/dist/node-latest.tar.gz | |
| tar -zxvf node-latest.tar.gz | |
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 verificarVarios(sorteados, jogos){ | |
| return jogos.map(function(jogo){ | |
| return encontrarSorteados(sorteados, jogo); | |
| }).sort(function(a, b){ return b.length - a.length; }); | |
| } | |
| function encontrarSorteados(sorteados, jogados){ | |
| return jogados.filter(function(numero){ | |
| return sorteados.indexOf(numero) !== -1; | |
| }); |
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 routes = ["/:id", "/author/:id", "/authors", "/author/foobar"]; | |
| routes.sort(function(a, b){ | |
| a = a.split("/"); | |
| b = b.split("/"); | |
| if(a.length !== b.length){ | |
| return a.length - b.length; | |
| }else{ | |
| for(var i = 0; i < a.length; i++){ |
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 findPrefix(strings){ | |
| if(strings && strings.length > 0){ | |
| var prefix = ""; | |
| var characters = strings[0].split(""); | |
| for(var i = 0; i < characters.length; i++){ | |
| var isPrefix = true; | |
| var character = characters[i]; | |
| for(var j = 0; j < strings.length; j++) { |
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
| #!upstart | |
| description "Starts Gammarouter" | |
| author "Renato Gama" | |
| start on runlevel [2345] | |
| stop on runlevel [^2345] | |
| respawn # restart when job dies | |
| respawn limit 5 60 # give up restart after 5 respawns in 60 seconds |
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
| npm http GET https://registry.npmjs.org/express | |
| npm http GET https://registry.npmjs.org/underscore | |
| npm http GET https://registry.npmjs.org/cliff | |
| npm http GET https://registry.npmjs.org/gleak | |
| npm http GET https://registry.npmjs.org/route-registrar/0.0.10 | |
| npm http GET https://registry.npmjs.org/jade | |
| npm http GET https://registry.npmjs.org/fonts/0.0.2 | |
| npm http GET https://registry.npmjs.org/portfinder | |
| npm http GET https://registry.npmjs.org/mongoose | |
| npm http GET https://registry.npmjs.org/connect-domain |
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 fs = require('fs'), | |
| path = require('path'), | |
| util = require('util'), | |
| assert = require('assert'); | |
| module.exports = function(appPath, testsPath, options){ | |
| if ( typeof testsPath === "object" ) { | |
| options = testsPath; | |
| testsPath = undefined; | |
| } |
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 getPrimeFactors(number){ | |
| var factors = [], factor; | |
| function getPrimeFactor(number) { | |
| for (var i = 2; i <= Math.sqrt(number); i++) { | |
| if(number % i === 0) { | |
| return i; | |
| } | |
| } | |
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
| echo "teste" |