Skip to content

Instantly share code, notes, and snippets.

@tibawatanabe
tibawatanabe / taki_tiler_install.md
Created August 15, 2019 20:52 — forked from alanraso/taki_tiler_install.md
Instalação do Taki Tiler (Onboard Taqtile)

Este tutorial apresenta os passos iniciais para criação do projeto de Onboard da Taqtile

1. Criação do repositório

Siga este tutorial e crie um repositório em sua conta para iniciar o projeto do Onboard.

2. Instalação do Bot

O bot Taki Tiler será um auxiliador das tarefas do Onboard. Ele apresentará as tarefas que serão desenvolvidas durante o treinamento. Para instalar, siga os passos:

  1. Acesse o link do bot
  2. Clique no botão Install
@tibawatanabe
tibawatanabe / exchange-message-between-node-process.js
Last active September 9, 2018 03:21
Example of how to exchange messages between node processes
// Sending messages
if (cluster.isMaster) {
// It's also possible to get workers by iterating over `cluster.workers` hash map:
// https://nodejs.org/api/cluster.html#cluster_cluster_workers
const worker = cluster.fork();
worker.send('Sending message to worker');
} else {
process.send('Sending message to master');
}
@tibawatanabe
tibawatanabe / once.ts
Created March 14, 2018 21:52
once in TS
// tslint:disable-next-line:ban-types
export function once(fn: Function): Function {
let executed = false;
let result: any;
// tslint:disable-next-line:only-arrow-functions
return function() {
if (executed) {
return result;
} else {
@tibawatanabe
tibawatanabe / save-heroku-config-vars-to-env.sh
Created September 30, 2017 20:16
Command line to save Heroku config vars into .env file
heroku config | sed 's/: */=/g; /^=/d' >> .env
@tibawatanabe
tibawatanabe / set-heroku-config-vars-from-env.sh
Created September 30, 2017 20:00
Command line to read .env file and set Heroku config vars
heroku config:set $(cat .env | sed '/^$/d; /#[[:print:]]*$/d')
@tibawatanabe
tibawatanabe / get-heroku-config-vars.bash
Last active September 30, 2017 19:59
Command line to get Heroku config vars
heroku config >> config.txt
@tibawatanabe
tibawatanabe / set-heroku-config-vars.sh
Last active August 12, 2020 04:52
Command line to set Heroku config vars
heroku config:set LOGGER_LEVEL=debug ENV=production CRYPTO_SECRET=guesswhat
@tibawatanabe
tibawatanabe / install-peers.js
Created September 24, 2017 20:34
Node script to install peer-dependencies
'use strict'
const exec = require('child_process').exec;
const { promisify } = require('util');
const execAsPromise = promisify(exec);
const packageJson = require('./package.json');
const commands = Object.entries(packageJson.peerDependencies)
@tibawatanabe
tibawatanabe / git-clone-fetch-branch.bash
Last active July 13, 2017 22:20
git fetch a single branch
git fetch <remote_name> <branch_name>
# or
git fetch --depth=<number_of_commits> <remote_name> <branch_name>
@tibawatanabe
tibawatanabe / git-clone-single-branch-limit-commit.bash
Last active July 13, 2017 21:52
git clone a single branch limiting commits
git clone -b <your_branch> --single-branch <your_repository_url> --depth <number_of_commits>