Skip to content

Instantly share code, notes, and snippets.

View ivanrosolen's full-sized avatar
:octocat:
....

Ivan Rosolen ivanrosolen

:octocat:
....
View GitHub Profile
@ivanrosolen
ivanrosolen / mac_install.md
Last active January 13, 2022 14:37
Mac install script

Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

basic (catalina)

brew install -f git jq jo telnet wget nmap

dev big-sur

brew install -f adr-tools php composer imagemagick ffmpeg exiftool

@ivanrosolen
ivanrosolen / links_novos_devs.md
Last active January 10, 2021 02:27
Links úteis para quem está aprendendo "dev"
@ivanrosolen
ivanrosolen / conventional_commits.md
Last active August 15, 2024 12:25 — forked from CesarDenis/CONTRIBUTING.md
Guia para mensagens de commits

Guia para mensagens de commits

Formato da mensagem

Cada mensagem de commit consiste em um cabeçalho, um corpo e um rodapé.

Cabeçalho

Tem um formato pré-definido, que inclui um tipo e um título:

@ivanrosolen
ivanrosolen / progress.php
Created June 10, 2019 17:55
Cli Progress Bar Loop
#!/usr/bin/php
<?php
$iloop = "0";
while (true){
$warn = "Program running hold on!!\r";
if (strlen($warn) === $iloop+1){
$iloop = "0";
}
$warn = str_split($warn);
@ivanrosolen
ivanrosolen / remove.sh
Created April 24, 2019 19:24
Quick remove first line from file
tail -n +2 file.sql > newfile.sql
@ivanrosolen
ivanrosolen / dump.sql
Last active April 19, 2019 15:42
Dump a specific table or few rows (MySQL)
mysqldump -h host_ip -u user -ppassword database_name > database_dump.sql
mysqldump -h host_ip -u user -ppassword database_name table_name > table_dump.sql
mysqldump -h host_ip -u user -ppassword database_name table_name --where="date_created='2019-04-19'" > rows_dump.sql
Big table, use nohup command &
If user is not root, you may add --lock-tables=false
@ivanrosolen
ivanrosolen / concurrency.js
Created March 15, 2019 22:16
NodeJS Concurrency
const http = require('http');
const cluster = require('cluster');
if (cluster.isMaster) {
console.info('Starting...');
console.info('Worker master started');
const numCpus = require('os').cpus().length;
@ivanrosolen
ivanrosolen / download_one_gitlab.md
Created March 15, 2019 14:29
Baixar um arquivo do gitlab
@ivanrosolen
ivanrosolen / check_size.sql
Created December 18, 2018 20:36
How to get the size of mysql tables?
-- All Databases and Tables
SELECT
table_schema AS `Database`,
table_name AS `Table`,
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`
FROM
information_schema.TABLES
ORDER BY
(data_length + index_length)
DESC;
@ivanrosolen
ivanrosolen / named_groups_regex.php
Created November 9, 2018 13:42
Named Capturing Group REGEX
<?php
$regex = "/(?'group1'[0-9]+)_(?'group2'.+)_(?'group3'[0-9A-Z]+).(?'ext'.+)$/";
$files = [
'01_lero_1X.pdf',
'02_lerolero_13.pdf',
'03_1k_KK.pdf'
];