Skip to content

Instantly share code, notes, and snippets.

View wallacesilva's full-sized avatar
🌎
Working Remotely

Wallace Silva wallacesilva

🌎
Working Remotely
View GitHub Profile
@wallacesilva
wallacesilva / resize window linux x11
Created June 28, 2018 17:47
Resize window active/focused with this script - [INCOMPLETE]
#!/bin/bash
# Wallace Silva - wallacesilva.com
dothis=true
toW=720
toH=560
nowW=0
nowH=0
increment=1
@wallacesilva
wallacesilva / dicas-devcaveman-video-i3-diolinux
Last active August 2, 2018 14:29
Lista de programas minimal pra usar com o i3 - Linux Otimizado
Gestor de arquivos *Ranger* (melhor de todos),
Terminal *URxvt*,
editor *NeoVim*,
*Nitrogen* para wallpaper,
*Rofi* é melhor que Dmenu,
*Polybar* é melhor que i3blocks e i3status,
*Pulseaudio* melhor que Alsa,
*ArandR* para configurar monitor,
player de música *Mocp*,
player de vídeo *VLC*,
@wallacesilva
wallacesilva / gist:ddb90b1ad6ac848f1c1c5e639d4855f8
Created July 18, 2019 13:32 — forked from bessarabov/gist:674ea13c77fc8128f24b5e3f53b7f094
One-liner to generate data shown in post 'At what time of day does famous programmers work?' — https://ivan.bessarabov.com/blog/famous-programmers-work-time
git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }'
#!/usr/bin/perl
# usage:
#
# git log --author="Sebastian Riedel" --format="%H %ai" | perl script.pl
#
use strict;
use warnings FATAL => 'all';
use utf8;
[
{
"ispb": "00000000",
"nome_simples": "BCO DO BRASIL S.A.",
"codigo": "001",
"participa_da_compe": "Sim",
"acesso_principal": "RSFN",
"nome": "Banco do Brasil S.A.",
"inicio_da_operacao": "22/04/2002"
},
@wallacesilva
wallacesilva / pg_dumb.py
Created August 7, 2020 22:03
Postgresql pg_dump parser
import argparse
from urllib.parse import urlparse
def parse_command(database_url, exclude_tables):
parsed_url = urlparse(database_url)
parsed_data = {
'hostname': parsed_url.hostname,
'username': parsed_url.username,
'password': parsed_url.password,