Skip to content

Instantly share code, notes, and snippets.

@mrioqueiroz
mrioqueiroz / .vimrc
Last active January 16, 2024 17:04
Basic .vimrc
set lazyredraw
set hidden
set number relativenumber
set expandtab shiftwidth=2 softtabstop=2 tabstop=2
set novisualbell noerrorbells belloff=all
set mouse=a
set ignorecase smartcase incsearch
set nowrap
nnoremap <space> <nop>
vnoremap <space> <nop>
sunmap <space>
let mapleader=" "
set timeoutlen=800
set number relativenumber
set scrolloff=15
set ignorecase smartcase incsearch hlsearch
set showmode showcmd
@mrioqueiroz
mrioqueiroz / capslock.nix
Created August 9, 2021 22:10
Caps Lock working as Esc and Ctrl on NixOS
{
services = {
xserver = {
enable = true;
xkbOptions = "caps:ctrl_modifier";
};
};
environment = {
shellInit = ''
xcape -e "Caps_Lock=Escape"
@mrioqueiroz
mrioqueiroz / keybindings.json
Created February 15, 2021 19:06
VSCode Keybindings
[
{ "key": "f6", "command": "workbench.action.terminal.focus"},
{
"key": "f6",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
{
"key": "ctrl+alt+b",
"command": "markdown.extension.editing.toggleBold",
@mrioqueiroz
mrioqueiroz / configuration.nix
Last active February 14, 2021 22:57
NixOS on Linode
# Usage: $ curl -L <link_to_this_gist>/raw > /mnt
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
];
from collections import Counter
from pprint import pprint
from string import ascii_letters, digits
from PIL import Image, ImageOps
from pytesseract import image_to_string
def obter_caracteres(imagem):
caracteres = [list() for _ in range(7)]
@mrioqueiroz
mrioqueiroz / StandardNfeReport.bas
Last active September 6, 2020 15:46
Padronização de tabela no Excel (WIP)
Sub MainCreateStandardReport()
Application.ScreenUpdating = False
Dim originalDataSheetName As String
Dim originalFileName As String
Dim originalFilePath As String
Dim filePath As String
Dim pathSep As String
Dim fileToSave As String
@mrioqueiroz
mrioqueiroz / UsefulSnippets.bas
Last active September 6, 2020 15:48
Trechos de macros para testes
Sub AddDateAndTimeMultipleTimes()
Dim userInput As Variant
userInput = Application.InputBox("How many times?")
If Not userInput = "" Then
For i = 1 To userInput
Call AddDateAndTimeOnce
Next i
ElseIf userInput = "" Then
Call AddDateAndTimeOnce
End If
@mrioqueiroz
mrioqueiroz / CopiarCnpj.bas
Last active September 6, 2020 15:48
Macro VBA para enviar CPF e CNPJ para Área de Transferência removendo os caracteres especiais
Sub RemoverFormatoECopiar()
Dim textoOriginal As String
Dim novoTexto As String
Dim contador As Integer
Dim areaDeTransferencia As New MSForms.DataObject
textoOriginal = ActiveCell.Value
For contador = 1 To Len(textoOriginal)
Dim caractere As String
@mrioqueiroz
mrioqueiroz / image_comparison.py
Last active September 15, 2021 20:14
Script para identificar diferenças entre imagens ou buscar imagens iguais em uma árvore de diretórios
import os
import sys
import cv2
def check_differences():
im1 = cv2.imread(sys.argv[1])
im2 = cv2.imread(sys.argv[2])
diff = cv2.subtract(im1, im2)