Skip to content

Instantly share code, notes, and snippets.

View arthur-mts's full-sized avatar
Focusing

Arthur Soares arthur-mts

Focusing
  • IFood
  • Remígio PB, Brazil
View GitHub Profile
@arthur-mts
arthur-mts / uuid_replacer.py
Created October 31, 2023 22:16
uuid_replacer helper
import re
import argparse
from uuid import uuid4
if __name__ == '__main__':
parser = argparse.ArgumentParser(prog = "uuid_replacer", description="Update all UUIDs from JSON file for random UUIDs")
parser.add_argument("input", help = ".json file name")
parser.add_argument("-o", "--output", help = "output filename. default = output.json", default="output.json", dest="output", required=False)
parser.add_argument("-i", "--ids", help="UUIDs to be replaced. (If ommited all UUIDs will be replaced)", required = False, nargs="*", action="store")
@arthur-mts
arthur-mts / .sh
Last active May 8, 2024 12:29
keyboard_detect.sh
#!/bin/bash
devices=$(lsusb)
command=""
while IFS= read -r line; do
if grep -q "Logitech, Inc. Logi TKL Mechanical Keyboard" <<< "$line"; then
#echo "$line"
#echo "There is a Logitch keyboard"
## Set the desired keymap
@arthur-mts
arthur-mts / remap.sh
Created March 16, 2023 21:30
Funções para remapear a tecla do lado do ; do teclado americano para funcionar como aspas/aspas duplas (e voltar a funcionar como acento)
## A tecla vai funcionar como " e ' (segurando SHIFT)
function remap_quote() {
xmodmap -e "keycode 48 = apostrophe quotedbl apostrophe quotedbl dead_acute dead_diaeresis dead_acute";
}
## A tecla vai funcionar como ´ e ¨ (e como ç apertando ´ e depois c)
## Dá pra usar ' e " aqui apertando espaço depois do acento também
function remap_accent() {
xmodmap -e "keycode 48 = dead_acute dead_diaeresis dead_acute dead_diaeresis apostrophe quotedbl apostrophe";
@arthur-mts
arthur-mts / cut_rod_pd.py
Created August 6, 2022 23:00
Resolução do problema cortes de hastes com programação dinâmica
def cut_rod_pd(p, n):
memory = {}
memory[0] = 0
memory[1] = p[1]
for i in range(2, n + 1):
best_choice = p[i]
for j in range(1, i // 2 + 1):
# print(f"Haste tamanho {i}, combinação {i - j}-{j}")
choice = memory[i - j] + memory[j]
if choice > best_choice:
[alias]
st = status
chk = checkout
pl = pull
hide = update-index --skip-worktree --
unhide = update-index --no-skip-worktree --
[user]
name = Arthur Mauricio Thomaz Soares
[gpg]
program = gpg2
@arthur-mts
arthur-mts / threaddemo.c
Created February 11, 2021 21:56
Modification of threaddemo.c
/* threaddemo.c */
/* Thread demonstration program. Note that this program uses a shared variable
in an unsafe manner (eg mutual exclusion is not attempted!) */
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
const clock_t MAXDELAY = 2000000;
const char *FIRST = "first thread";
@arthur-mts
arthur-mts / .json
Created June 23, 2020 14:43
.eslintec.json to react typescript
{
"env": {
"browser": true,
"es6": true
},
"extends": [
"plugin:react/recommended",
"airbnb",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
@arthur-mts
arthur-mts / .editorconfig
Created May 20, 2020 21:43
My editorconfig
root = true
[*]
ident_style = space
ident_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
@arthur-mts
arthur-mts / api.xml
Created March 11, 2020 21:25
Exemplos de pom.xml para projeto Java POO
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>projeto-heranca</artifactId>
<groupId>br.ifpb.edu</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>