Skip to content

Instantly share code, notes, and snippets.

View airtonzanon's full-sized avatar

Airton Zanon airtonzanon

View GitHub Profile
@airtonzanon
airtonzanon / pre-commit
Created December 8, 2023 14:46
PHPSTAN + PHPCS FIX - .git/hooks/pre-commit
fileList=$(git diff --cached --name-only)
phpFileList=$(echo "$fileList" | grep -E '\.(php)$')
if [ ${#phpFileList} -gt 0 ]; then
git stash --keep-index --include-untracked
if ! docker exec YOUR_CONTAINER php -d memory_limit=4G vendor/bin/phpstan analyse ${phpFileList[*]} "$@"; then
git stash pop
exit 1
fi
@airtonzanon
airtonzanon / php_74_phpdoc_to_property_type.txt
Created July 5, 2022 15:44
PHP 7.4 php doc (one line) to property type vim macro
wwwwvwhyjhhpkddjj0
@airtonzanon
airtonzanon / show_time_spent_per_language.py
Last active April 8, 2022 13:06
Show languages used on the day and time spent on them - Pimorony Inky
#!/usr/bin/env python3
import argparse
import socket
import requests
import datetime
from PIL import Image, ImageFont, ImageDraw
from datetime import date
from font_hanken_grotesk import HankenGroteskBold, HankenGroteskMedium
@airtonzanon
airtonzanon / .zshrc
Last active February 7, 2024 10:00
my zsh file
export ZSH="/Users/airtonzanon/.oh-my-zsh"
ZSH_THEME="robbyrussell"
plugins=(git zsh-autosuggestions)
source $ZSH/oh-my-zsh.sh
alias vim="nvim"
alias projects="cd ~/Documents/projects"
@airtonzanon
airtonzanon / cmdline.txt
Created May 4, 2021 12:44
raspberry py boot files + Waveshare LCD 5 inch
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=334dade7-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo quiet init=/usr/lib/raspi-config/init_resize.sh splash plymouth.ignore-serial-consoles
call plug#begin()
Plug 'ctrlpvim/ctrlp.vim'
Plug 'mkitt/tabline.vim'
Plug 'arcticicestudio/nord-vim'
Plug 'terryma/vim-multiple-cursors'
Plug 'wakatime/vim-wakatime'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'dense-analysis/ale'
call plug#end()
PHP 2:58h - 44.33% ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
SQL 2:09h - 32.26% ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
YAML 1:26h - 21.45% ▓▓▓▓▓▓▓▓▓▓▓▓
JSON 0:03h - 0.77% ▓
Text 0:03h - 0.77% ▓
Docker 0:01h - 0.34% ▓
Vue.js 0:00h - 0.07%
Bash 0:00h - 0.00%
JavaScript 0:00h - 0.00%
@airtonzanon
airtonzanon / get_wakatime_to_ascii.py
Last active March 5, 2020 21:11
Get your wakatime spend on languages and create an ascii chart.
import requests, json, os
# To get the WAKATIME_JSON_URL_PER_LANGUAGE
# Go to https://wakatime.com/share/embed, choose JSON format, choose languages chart type
# Click on "Get Embeddable Code", copy the url that it'll show
resp = requests.get(os.environ.get('WAKATIME_URL'))
data = []
for wakadata in resp.json()["data"]:
@airtonzanon
airtonzanon / named_constructor.py
Last active April 28, 2020 21:03
Create named construct with python
class NamedConstructor:
def __init__(self,
name: str,
age: int):
self.name = name
self.age = age
def create_person_from_dict(person_data: dict):
return NamedConstructor(
name = person_data['name'],
@airtonzanon
airtonzanon / init.vim
Last active July 12, 2023 12:59
~/.config/nvim/
call plug#begin()
Plug 'ctrlpvim/ctrlp.vim'
Plug 'mkitt/tabline.vim'
Plug 'arcticicestudio/nord-vim'
Plug 'terryma/vim-multiple-cursors'
Plug 'wakatime/vim-wakatime'
call plug#end()
colorscheme nord