Skip to content

Instantly share code, notes, and snippets.

View vitormil's full-sized avatar

Vitor Oliveira vitormil

View GitHub Profile
@vitormil
vitormil / .gitconfig
Last active July 13, 2023 11:12
git-delta
[init]
defaultBranch = master
[alias]
b = branch
aa = add --all
st = status
s = status -sb
co = checkout
ci = commit -v
cp = cherry-pick
@vitormil
vitormil / pre-commit
Created May 10, 2023 09:33
Git Hooks
#!/bin/sh
current_branch=`git rev-parse --abbrev-ref HEAD`
if [[ $current_branch =~ master|main ]]; then
message="Please don't commit directly to $current_branch."
echo "💥 \033[1;31mERROR: $message\033[0m";
exit 1
fi
@vitormil
vitormil / keybindings.json.txt
Created July 15, 2022 15:25
3 Keyboard Shortcuts to Navigate Your Code Faster
[
// IntelliJ -> Navigate - Back
{
"key": "cmd+[",
"command": "workbench.action.navigateBack"
},
// IntelliJ -> Navigate - Forward
{
"key": "cmd+]",
"command": "workbench.action.navigateForward"
@vitormil
vitormil / settings.json
Created June 14, 2022 14:46
VS Code settings
{
"workbench.colorTheme": "Night Owl",
"workbench.iconTheme": "material-icon-theme",
"editor.fontFamily": "'Dank Mono', 'JetBrains Mono', Menlo, Monaco, 'Courier New', monospace",
"editor.fontWeight": "400",
"workbench.startupEditor": "newUntitledFile",
@vitormil
vitormil / .gitconfig
Created January 27, 2022 14:41
diff-so-fancy configuration
...
[interactive]
diffFilter = diff-so-fancy --patch
[color "diff-highlight"]
oldNormal = red
oldHighlight = red 52
newNormal = green
newHighlight = green 22
[color "diff"]
create table test (id int, a timestamp) partition by list ( (trunc(extract(second from a))::int % 3));
create table test01 partition of test for values in (0);
create table test02 partition of test for values in (1);
create table test03 partition of test for values in (2);
insert into test values (555, now());
select *
from test
@vitormil
vitormil / settings-windows-terminal.json
Created April 18, 2021 02:46
Windows Terminal Settings
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions": [
{
"command": {
"action": "copy",
"singleLine": false
},
"keys": "ctrl+c"
},
@vitormil
vitormil / keyboard.sh
Last active March 14, 2021 14:18
How to increase keyboard key repeat rate on OS X?
defaults write -g ApplePressAndHoldEnabled -bool false
defaults write -g InitialKeyRepeat -int 10 # normal minimum is 15 (225 ms)
defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms)
@vitormil
vitormil / Gemfile
Created March 7, 2021 15:03 — forked from dhh/Gemfile
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@vitormil
vitormil / dockercomplete.sh
Created January 7, 2021 22:08
docker zsh autocomplete (for macOS)
ln -s /Applications/Docker.app/Contents/Resources/etc/docker.zsh-completion /usr/local/share/zsh/site-functions/_docker
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-compose.zsh-completion /usr/local/share/zsh/site-functions/_docker-compose
echo "autoload -Uz compinit; compinit" >> .zshrc