Skip to content

Instantly share code, notes, and snippets.

View marcocarvalho's full-sized avatar

Marco Carvalho marcocarvalho

  • mcorp.io
  • Curitiba - PR - Brasil
View GitHub Profile
@marcocarvalho
marcocarvalho / youtube_unsubscribe.js
Last active November 5, 2020 20:27
Mass unsubscribe from youtube channel subscriptions using whitelist
const whitelist = ['Cancelar inscrição de Kurzgesagt – In a Nutshell.',
'Cancelar inscrição de 3D Geek Show - Impressão 3D.',
'Cancelar inscrição de ABANAorg.',
'Cancelar inscrição de Adam Savage’s Tested.',
'Cancelar inscrição de Adilson Carvalho.',
'Cancelar inscrição de Alec Steele.',
'Cancelar inscrição de Alexandre Benchimol.',
'Cancelar inscrição de Alexandre Bigunas.',
'Cancelar inscrição de Aquele Flau [OFICIAL].',
'Cancelar inscrição de Atila Iamarino.',
@marcocarvalho
marcocarvalho / remove_branches.sh
Last active April 20, 2020 14:29
Remove branches from CM
# select concat('drop database if exists ', datname, ';') from pg_database where left(datname, 11) = 'caremessage' and datname not like '%master%' and datname not like '%staging%'
ignores=(\* master staging)
for branch in $(git branch)
do
if [[ " ${ignores[@]} " =~ " ${branch} " || "$CURRENT_WORK" = "$branch" ]]; then continue; fi
git checkout $branch
@marcocarvalho
marcocarvalho / fornecedores.txt
Last active December 19, 2019 17:22
Fornecedores de cutelaria
LISTA DE FORNECEDORES
Grupo ⚔Insumos para Cutelaria⚔
(Milton Vaz)
Publicação 18/12/19
AÇO CARBONO :
- Fer Álvares - 19 99788.4059
- Maxime Ferrum (Synesio) - 19 3886.6486 | 12 99131.9669
- Aço Nobre - 15 99729.2068
@marcocarvalho
marcocarvalho / calc.rb
Created December 18, 2018 01:37
Heat treat oven line distribuition
# nTT = numedo de triangulos 13
# nTO = numero de triangulos onze
# nTT * c + nTO * c = 100
# c ( NTT + nTO ) = 100
# nTT * hTT + nTO * hTO = 270
# hTO = √cˆ2 + 11,5 ^ 2
@marcocarvalho
marcocarvalho / .bashrc
Created March 14, 2018 18:17
Habilitar o CTRL + arrow right/left no bash.
# No .bashrc (tem que desligar o mission control nos shortcuts de teclado)
bind '"\e[5C": forward-word'
bind '"\e[5D": backward-word'
bind '"\e[1;5C": forward-word'
bind '"\e[1;5D": backward-word'
@marcocarvalho
marcocarvalho / rspec-update.rb
Created December 22, 2017 16:31
Upgrade rspec 2.x to 3.x
# http://rspec.info/upgrading-from-rspec-2/
^(\s*)(.*?)\.stub\((.*?)\) -> \1allow(\2).to receive(\3)
^(\s*)(.*?)\.should\s*be_true -> \1expect(\2).to be_truthy
^(\s*)(.*?)\.should == -> \1expect(\2).to eq
^(\s*)(.*?)\.should_receive[\s\(]*(:\S*)\)* -> \1expect(\2).to receive(\3)
@marcocarvalho
marcocarvalho / inspect.rb
Created December 22, 2017 11:06
Ver por onde o código bate
@trace = []
set_trace_func proc { |event, file, line, id, binding, classname|
if event == 'call' && ( file.index('/app/') || file.index('gaia') )
@trace << { number: @trace.count, event: event, file: file, line: line, method_name: id, classname: classname.to_s }
end
}
# Code you want to inspect
set_trace_func nil
@marcocarvalho
marcocarvalho / sed.sh
Created May 25, 2017 13:52
SED incluir uma linha a cada X linhas
sed '0~1000 s/$/\nlogit/g' < filename > filename2
@marcocarvalho
marcocarvalho / jvm.options
Created February 1, 2017 02:09
Elasticsearch jvm.options
## JVM configuration
################################################################
## IMPORTANT: JVM heap size
################################################################
##
## You should always set the min and max JVM heap
## size to the same value. For example, to set
## the heap to 4 GB, set:
##
@marcocarvalho
marcocarvalho / fix1.bat
Last active September 21, 2016 19:01
Windows6.1-KB958488-v6001-x86.msu 0xc8000222 .NET 4.5 instalation error
:: Resolve o problema de instalação do .NET 4.5 Windows6.1-KB958488-v6001-x86.msu 0xc8000222
net stop wuauserv
ren c:\windows\SoftwareDistribution softwaredistribution.old
net start wuauserv