Skip to content

Instantly share code, notes, and snippets.

View gabrielbidula's full-sized avatar

Gabriel Borges Oliveira gabrielbidula

View GitHub Profile
@gabrielbidula
gabrielbidula / pint.sh
Last active February 19, 2024 16:12
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
%s/\(\w\)\(\w*\)/\U\1\L\2/g #capitalize words
0xe295cFcd1666800726B4ed8ffF59F32e814b7bE9