Skip to content

Instantly share code, notes, and snippets.

View abairo's full-sized avatar

Anderson Bairo abairo

  • Curitiba, Paraná - Brasil
View GitHub Profile
@abairo
abairo / flutter-setup.sh
Created April 18, 2024 00:56
Flutter Development Environment
install_flutter () {
echo "installing flutter..."
sudo snap install flutter --classic
}
display_flutter_sdk_path () {
echo "displaying flutter sdk path..."
flutter sdk-path
}

openapi-generator

Generate clients, servers, and documentation from OpenAPI 2.0/3.x documents

For Python example, run the command below in a terminal:

docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i https://petstore.swagger.io/v2/swagger.yaml -g python -o /local/out/python

The generated code will be in the out folder from the current path ${PWD}. So, if you need to change the folder permissions for the current user, run:

# For installation windows managers, set this variables
_JAVA_AWT_WM_NONREPARENTING=1
export _JAVA_AWT_WM_NONREPARENTING
# Add permissions to usb port
sudo chmod a+rw /dev/ttyUSB0

Edit the file /etc/modprobe.d/default.conf:

options snd_hda_intel index=1
1 - install nvidia packages and xorg-server:
sudo pacman -S nvidia nvidia-utils nvidia-settings xorg-server-devel opencl-nvidia
2 - insert noveau on blacklist:
/usr/lib/modprobe.d/nvidia.conf
blacklist nouveau
3 - run nvidia command to create xorg.conf:
nvidia-xconfig --prime
4 - Edit the grub config: /etc/default/grub and update grub
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet nvidia-drm.modeset=1
5 - add new conf to .xinitrc:
google search:
intext:"buscar por" intitle:"index.of" (pdf|mobi|epub) -inurl:(php|html|aspx|shtml)
@abairo
abairo / iterador_simples.py
Created October 4, 2019 16:04
Iterador simples
import csv
# inicializa o contador de linhas
numero_da_linha = 1
# abre o arquivo
with open('vazao.csv') as arquivo_csv:
# Lê o arquivo csv
arquivo_lido = csv.reader(arquivo_csv, delimiter=',')
# itera o arquivo de forma simples
for linha_arquivo in arquivo_lido:
@abairo
abairo / iterador_avancado.py
Last active October 4, 2019 16:03
iteradores de csv
import csv
def iterador_avancado():
# abre o arquivo
with open('vazao.csv', "r") as arquivo_csv:
# Lê o arquivo csv
for linha_arquivo in csv.reader(arquivo_csv):
# retorna linha iterada
yield linha_arquivo
exec --no-startup-id /usr/lib/kdeconnectd
exec --no-startup-id kdeconnect-indicator
@abairo
abairo / config.ini
Created September 10, 2019 01:59
./.android/avd/pixel.avd/
PlayStore.enabled = false
abi.type = x86_64
avd.ini.encoding = UTF-8
hw.accelerometer = no
hw.audioInput = no
hw.battery = no
hw.cpu.arch = x86_64
hw.dPad = no
hw.device.hash2 = MD5:984dbf66b1aaafcdb7e89573ffb74b46
hw.device.manufacturer = Google