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
# /etc/nginx/conf.d/default.conf | |
server { | |
listen 80; | |
server_name localhost; | |
... | |
location / { | |
root /usr/share/nginx/html; |
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 getPathWithKey(path, key) { | |
return typeof path === 'string' ? `${path}[${key}]` : key; | |
} | |
/** | |
* Esta função converte um objeto plano com chaves aninhadas para | |
* o formato esperado pelo URLSearchParams, que é utilizado nas requisições | |
* que exige o "Content-Type": "application/x-www-form-urlencoded". | |
* | |
* Um objeto com estrutura |
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/sh | |
CONFIG_FILE=/etc/docker/daemon.json | |
cat << CONFIG > $CONFIG_FILE | |
{ | |
"log-driver": "json-file", | |
"log-opts": { | |
"max-size": "50m", | |
"max-file": "1" |
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
# https://enable-cors.org/server_nginx.html | |
server { | |
listen 80; | |
server_name localhost; | |
#charset koi8-r; | |
#access_log /var/log/nginx/host.access.log main; | |
root /usr/share/nginx/html; |
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
alias yi='yarn install' | |
alias ya='yarn add $@' | |
alias yad='yarn add -D $@' | |
alias cai='rm -rf node_modules && yarn install' | |
alias rnra='react-native run-android' | |
alias rnri='react-native run-ios' | |
alias docp='docker container prune -f' | |
alias dosp='docker system prune --all' |
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 convertTimeToHumanReadable(time) { | |
const units = [ | |
['days', 480], // 8 horas (8 * 60) | |
['hours', 60], | |
['minutes', 1], | |
]; | |
function reducer({ duration, ...others }, [unit, amount]) { | |
const result = Math.floor(duration / amount); |
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
/** | |
* Get object path value or return defaultValue | |
* @param {object} object Object to get path value | |
* @param {string[]} keys Object path in an array | |
* @param {any} defaultValue Default value if the path does not exists | |
*/ | |
function getPath(object, keys, defaultValue) { | |
if (keys.length === 1) { | |
const [curr] = keys; | |
return object[curr]; |
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
FROM openjdk:8-jdk | |
ENV ANDROID_COMPILE_SDK="28" | |
ENV ANDROID_BUILD_TOOLS="28.0.3" | |
ENV ANDROID_SDK_TOOLS="4333796" | |
ENV ANDROID_HOME="${PWD}/android-sdk-linux" | |
ENV PATH="${PATH}:${PWD}/android-sdk-linux/platform-tools/" | |
RUN apt update -qy; \ | |
apt install -qy curl unzip; \ |
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 { Writable } = require('stream'); | |
const { createReadStream } = require('fs'); | |
const Split = require('stream-split'); | |
const input = createReadStream('./votacao_candidato_munzona_2018_PR.csv', { encoding: 'latin1' }); | |
// const [nl] = Buffer.from('\n'); | |
// const buffer = Buffer.from('Edvaldo\nSzymonek'); | |
// console.log(buffer[7] === nl); |
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 | |
MSG="$(cat $1)" | |
if [[ "$MSG" =~ ^\#[0-9]+ ]]; then | |
echo "gam-backlog${MSG}" > $1 | |
fi |
NewerOlder