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
const HTTPS = require("https"); | |
/** | |
* @param {string | HTTPS.RequestOptions | URL} options | |
* @returns {Promise<string>} | |
*/ | |
function MakeRequest(options) { | |
return new Promise((Ok, Err) => { | |
HTTPS.request(options, res => { | |
// console.log(`statusCode: ${res.statusCode}`); |
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
# Directory: | |
# All Users : /usr/share/applications | |
# Single User: ~/.local/share/applications | |
[Desktop Entry] | |
Type=Application | |
Name=Program Name | |
Comment=This is a sample .desktop file | |
Exec=/path/to/executable | |
Icon=/path/to/icon.png |
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
# Copie este arquivo e cole | |
# no final do arquivo ~/.bashrc | |
# https://en.wikipedia.org/wiki/ANSI_escape_code#Colors | |
NO_COLOR='\033[0m' | |
COLOR_BLACK='\033[0;30m' | |
COLOR_RED='\033[0;31m' | |
COLOR_GREEN='\033[0;32m' | |
COLOR_YELLOW='\033[0;33m' |
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
# Este bash script cria um novo diretório na pasta | |
# /tmp para o testes rápidos sobre qualquer coisa. | |
# https://en.wikipedia.org/wiki/ANSI_escape_code#Colors | |
NO_COLOR='\033[0m' | |
COLOR_BLACK='\033[0;30m' | |
COLOR_RED='\033[0;31m' | |
COLOR_GREEN='\033[0;32m' | |
COLOR_YELLOW='\033[0;33m' |
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 sum(a, b) { | |
[xored, carry] = _sum_step(a, b) | |
while(carry) { | |
[xored, carry] = _sum_step(xored, carry) | |
} | |
return xored | |
} | |
function _sum_step(a,b) { | |
xored = a ^ b |
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
# Adições realizadas ao meu .bashrc | |
if [ -f ~/.bash_path ]; then | |
ADD_TO_PATH=$(cat ~/.bash_path) | |
for p in $ADD_TO_PATH; do | |
if [[ $(echo $p | head -c 1) != '#' ]]; then | |
PATH=$PATH:$p | |
fi | |
done | |
fi |
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
class FormURLEncoded extends Map { | |
/** | |
* @param {Nullable<String>} formString - Form URL encoded string (ex: `'hello=world&foo=bar&tar=gz'`) | |
*/ | |
constructor(formString = null) { | |
super(formString ? | |
formString | |
.trim() | |
.split('&') | |
.map( |
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
#!/bin/bash | |
# https://en.wikipedia.org/wiki/ANSI_escape_code#Colors | |
NO_COLOR='\033[0m' | |
COLOR_BLACK='\033[0;30m' | |
COLOR_RED='\033[0;31m' | |
COLOR_GREEN='\033[0;32m' | |
COLOR_YELLOW='\033[0;33m' | |
COLOR_BLUE='\033[0;34m' |
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
console.time('timer'); | |
const teams = { | |
tank: { | |
size: 8, | |
slots: 2 | |
}, | |
damage: { | |
size: 17, | |
slots: 2 |
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
#!/bin/bash | |
download_image() { | |
# 1 -> Download image name | |
# 2 -> Output path | |
REF=http://www.simepar.br/ | |
URL=https://lb01.simepar.br/riak/pgw-radar/$1 | |
curl --silent --referer $REF --output $2 $URL |
OlderNewer