Skip to content

Instantly share code, notes, and snippets.

@wisentini
wisentini / municipios-ibge.csv
Created January 21, 2024 16:06
Municípios brasileiros obtidos pelo IBGE.
codigo nome codigo_uf
5200050 Abadia de Goiás 52
3100104 Abadia dos Dourados 31
5200100 Abadiânia 52
3100203 Abaeté 31
1500107 Abaetetuba 15
2300101 Abaiara 23
2900108 Abaíra 29
2900207 Abaré 29
4100103 Abatiá 41
@wisentini
wisentini / ufs-ibge.csv
Created January 21, 2024 16:05
UFs brasileiras obtidas pelo IBGE.
codigo nome sigla codigo_regiao
12 Acre AC 1
27 Alagoas AL 2
16 Amapá AP 1
13 Amazonas AM 1
29 Bahia BA 2
23 Ceará CE 2
53 Distrito Federal DF 5
32 Espírito Santo ES 3
52 Goiás GO 5
@wisentini
wisentini / regioes-ibge.csv
Created January 21, 2024 16:05
Regiões brasileiras obtidas pelo IBGE.
codigo nome sigla
5 Centro-Oeste CO
2 Nordeste NE
1 Norte N
3 Sudeste SE
4 Sul S
@wisentini
wisentini / str-to-int.c
Created August 28, 2022 16:00
Convert a string to an integer in C.
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
int str_to_int(char *str)
{
int base = 10;
char *end_ptr;
errno = 0;
@wisentini
wisentini / reset-seq.sql
Last active December 19, 2022 15:09
Reset sequence in Postgres.
SELECT SETVAL('table_pkcolumn_seq', (SELECT MAX(pkcolumn) FROM public.table));
@wisentini
wisentini / google-chrome-dark-mode-linux-gnome.md
Last active October 20, 2022 09:58
Enable dark mode on Google Chrome under Linux (GNOME environment).

Enable dark mode on Google Chrome under Linux (GNOME environment)

  1. Create a new google-chrome.desktop file using Chrome's default:

    cp /usr/share/applications/google-chrome.desktop ~/.local/share/applications/google-chrome.desktop
  2. Edit the google-chrome.desktop file that was just created:

@wisentini
wisentini / get_str.c
Created April 8, 2021 21:48
A function to read a string of unknown length from stdin in C.
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
char *get_str(void)
{
char *str = malloc(sizeof (char));
if (!str) {
printf("\nUnable to allocate memory.\n");