Skip to content

Instantly share code, notes, and snippets.

View gabrielbidula's full-sized avatar

Gabriel Borges Oliveira gabrielbidula

View GitHub Profile
@gabrielbidula
gabrielbidula / gist:2f540b3bc22493f77e7d01757bff85df
Created November 2, 2024 11:37
Karabiner Elements - Change Fn + hjkl to arrows
{
"description": "Change Fn + h/j/k/l to Arrows",
"manipulators": [
{
"from": {
"key_code": "h",
"modifiers": {
"mandatory": ["fn"],
"optional": ["caps_lock"]
}
@gabrielbidula
gabrielbidula / tmux.conf
Created August 23, 2024 20:22
Eva01 Tmux conf - based on Neon Genesis Evangelion - Includes mute and bright version
# Eva Unit 01 inspired color scheme (muted version)
# Main colors
set -g status-style 'bg=#2e2e2e fg=#7851a9'
# Window list colors
setw -g window-status-style 'fg=#7851a9 bg=#2e2e2e'
setw -g window-status-current-style 'fg=#2e2e2e bg=#7851a9 bold'
# Pane border colors
set -g pane-border-style 'fg=#7851a9'
@gabrielbidula
gabrielbidula / pint.sh
Last active October 30, 2024 04:00
fake laravel pint formatter mode
#!/bin/bash
# Check if an argument was provided
if [ $# -eq 0 ]; then
echo "No file path provided."
exit 1
fi
# Use the provided argument (file path)
file="$1"
@gabrielbidula
gabrielbidula / settings.json
Last active March 1, 2024 09:38
zed settings.json
// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run the `open default settings` command
// from the command palette or from `Zed` application menu.
{
"base_keymap": "VSCode",
@gabrielbidula
gabrielbidula / create_user_and_database_ang_grant_on_mysql_mariadb.sh
Created February 3, 2023 19:30
create a user / create a database / grant access privileges on mysql/mariadb
#! /bin/bash
newUser='testuser'
newDbPassword='testpwd'
newDb='testdb'
host=localhost
#host='%'
# MySQL 5.7 and earlier versions
#commands="CREATE DATABASE \`${newDb}\`;CREATE USER '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT USAGE ON *.* TO '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT ALL privileges ON \`${newDb}\`.*
@gabrielbidula
gabrielbidula / .ideavimrc
Created January 3, 2023 08:28
.ideavimrc
let mapleader = ","
set scrolloff=5
set incsearch
map Q gq
set rnu
set showmode
set clipboard+=unnamed
set ideastrictmode
@gabrielbidula
gabrielbidula / latency.txt
Created June 9, 2022 14:07 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@gabrielbidula
gabrielbidula / coc-settings.json
Created December 16, 2020 14:24
CocConfig - coc-settings.json
{
"languageserver": {
"intelephense": {
"command": "intelephense",
"args": ["--stdio"],
"filetypes": ["php"],
"initializationOptions": {
"storagePath": "/tmp/intelephense"
}
},
@gabrielbidula
gabrielbidula / plan.sh
Created December 2, 2019 09:11
shellscript to send post requests in a curl loop
#!/bin/bash
array=('{
"product_id": "",
"name": "Private Austria (20.00%)",
"description": "Private Austria (20.00%)",
"billing_cycles": [
{
"frequency": {
"interval_unit": "MONTH",
@gabrielbidula
gabrielbidula / leads.sh
Created August 5, 2019 14:01
shellscript to run a cron in range of dates
#!/bin/bash
d=2019-04-01
while [ "$d" != 2019-08-04 ]; do
echo $d
php artisan export:adverts:fetch:leads --date="$d"
d=$(date -I -d "$d + 1 day")
done