/* Constantes */
Math.E // número de Euler.
Math.PI // número pi.
Math.SQRT2 // Raíz cuadrada de 2.
Math.SQRT1_2 // Raíz cuadrada de 1 / 2.
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
nodejs -e 'require("http").createServer((req, res) => { res.end("response"); }).listen(8080);' |
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
import java.util.Scanner; | |
public class Factorial { | |
public static int fact (int val) { | |
if (val == 0) | |
return 1; | |
return val * fact(val - 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
module.exports = {} | |
// Resolve the problem with the context (is by webpack). | |
Object.keys(module.exports).forEach(function (key) { | |
if (typeof module.exports[key] === 'function') { | |
module.exports[key] = module.exports[key].bind(module.exports) | |
} | |
}) |
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
const http = require('http') | |
const server = http.createServer() | |
server.on('request', function (req, res) { | |
req.pipe(res) | |
}) | |
server.listen(8000) |
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
const http = require('http') | |
const server = http.createServer() | |
server.on('request', function (req, res) { | |
res.writeHead(200) | |
req.on('data', function (chunk) { | |
console.log(chunk.toString()) | |
}) | |
res.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
alias gits='git status -s' | |
alias gitl='git log --oneline' | |
alias gitc='git commit -m' | |
alias gita='git add --all' | |
alias gitp='git push -u origin master' | |
alias gitd='git diff' | |
alias gitpl='git pull' | |
alias gitpb='git push origin' |
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
import moment from 'moment'; | |
/** | |
* Validate if a string is valid or not. | |
* | |
* @param {string} stringToTest - The string to validate. | |
* @param {boolean} [allowEmpty=false] - If a empty string should be valid or not. | |
* @param {boolean} allowNull - Returns true if the value is null | |
* @returns {boolean} If the string is valid or not. | |
*/ |