Skip to content

Instantly share code, notes, and snippets.

View jfollmann's full-sized avatar
🏠
Working from home

Jefferson Follmann jfollmann

🏠
Working from home
View GitHub Profile
@jfollmann
jfollmann / Instalação SmartClient - Linux
Created May 24, 2019 16:58
Instalação SmartClient - Linux
Download do SmartClient:
https://suporte.totvs.com/portal/p/10098/download#all/all/all/search/smartclient
* Baixar versão: SMARTCLIENT VERSÃO 12 LINUX BUILD 13.2.3.38
Executar os seguintes passos (terminal):
mkdir /totvs
chmod 777 /totvs
cd /totvs
{
"diffEditor.ignoreTrimWhitespace": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.codeLens": true,
"editor.columnSelection": false,
"editor.detectIndentation": false,
@jfollmann
jfollmann / docker & docker-compose
Last active December 15, 2023 21:13
Docker/Compose - Comandos Comuns
- Instalação docker:
curl -fsSL get.docker.com -o get-docker.sh
sh get-docker.sh
- Instalação docker-compose (Verificar nas referencias ultima versão¹):
sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
- Instalação ctop (Opcional - Verificar nas referencias ultima versão²)
sudo wget https://github.com/bcicen/ctop/releases/download/v0.7.1/ctop-0.7.1-linux-amd64 -O /usr/local/bin/ctop
sudo chmod +x /usr/local/bin/ctop
@jfollmann
jfollmann / intersection-difference-union.js
Created June 16, 2021 12:14
Array intersection, difference, and union in ES6
const arrA = [1, 3, 4, 5];
const arrB = [1, 2, 5, 6, 7];
const intersection = arrA.filter((x) => arrB.includes(x));
console.log('intersection', intersection);
// Output => intersection [ 1, 5 ]
const differenceA = arrA.filter((x) => !arrB.includes(x));
console.log('differenceA', differenceA);
// Output => difference [ 3, 4 ]
@jfollmann
jfollmann / spread-destructuring-rest-operator.js
Last active May 17, 2023 12:01
Spread, Destructuring and Rest Operator (Javascript)
// Execute: node spread-destructuring-rest-operator.js
// #### Spread Operator ####
const e1 = 'CODE';
const r1 = [...e1];
console.log('[01]', r1)
// Output => [ 'C', 'O', 'D', 'E' ]
const e2 = ['This', 'is', 'a', 'sentence'];
console.log('[02]', ...e2);
@jfollmann
jfollmann / hyper.js
Created February 23, 2023 01:54
Hyper Config
"use strict";
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
// default font size in pixels for all tabs
@jfollmann
jfollmann / rds_postgres_dump_restore.md
Last active December 20, 2022 16:58
How to create dump with docker to RDS postgres database

Create dump:

docker exec -i CONTAINER_NAME /bin/bash -c "PGPASSWORD=DATABASE_PASSWORD pg_dump --username DATABASE_USER -h RDS_HOST DATABASE_NAME" > ./dump.sql

Create local db to restore dump:

create database "db-restored"
Pega esse desafio:
Faça a soma de todos os produtos de todas as compras sem usar laços (loops - for, foreach, etc).
Use apenas map, reduce, recursão, etc.
const data = {
compras: [
{
data: '2022-01-01',
produtos: [
[global_config]
title_font = Ubuntu 9
title_receive_bg_color = "#8be9fd"
title_transmit_bg_color = "#ff5555"
[keybindings]
split_horiz = <Primary><Alt>e
[layouts]
[[default]]
[[[child1]]]
parent = window0
@jfollmann
jfollmann / contribs.sh
Created August 13, 2021 17:22
Show git repository contribs
#!/bin/env zsh
team_total=$(git shortlog -s -n |sed 's/\t/,/g'|cut -f1 -d, |bc -l|awk '{sum+=$1}END{print sum}');
tmp_counter='/tmp/counter.txt';
tmp_user='/tmp/users.txt';
tmp_percentage='/tmp/counters_users'
# if you are running this again it make the file empty or you can rm it
rm $tmp_percentage $tmp_user $tmp_counter
git shortlog -s -n |sed 's/\t/,/g'|cut -f2 -d, >>$tmp_user;
git shortlog -s -n |sed 's/\t/,/g'|cut -f1 -d, >>$tmp_counter;