Skip to content

Instantly share code, notes, and snippets.

View eliocapelati's full-sized avatar
👋
Hello world!

Elio eliocapelati

👋
Hello world!
View GitHub Profile
@eliocapelati
eliocapelati / 4panes.py
Last active October 17, 2024 21:35
open 4 panes in the same window using the current session and execute a command there. This is super handy when working in a project with multiple steps required to run and monitor it. Check out here how to use it: https://iterm2.com/python-api/tutorial/running.html
import iterm2
WORKING_DIRECTORY = "/path/to/your/folder"
async def main(connection):
app = await iterm2.async_get_app(connection)
window = app.current_terminal_window
if window is not None:
# Get the current session (pane)
@eliocapelati
eliocapelati / .alias99
Created September 23, 2024 22:27
Find and kill Rails process running on top of puma
function killr(){
ps -ef | grep puma | awk '{print $2}' | xargs kill -9 >> /dev/null 2>&1
}

Sunday, 01 Sep 2024

if defined?(PryByebug)
Pry.config.pager = false
Pry.commands.alias_command 'c', 'continue'
Pry.commands.alias_command 's', 'step'
Pry.commands.alias_command 'n', 'next'
Pry.commands.alias_command 'e', 'exit'
end
@eliocapelati
eliocapelati / languagetool.sh
Last active January 7, 2024 20:32
Grammarly replacement
#!/usr/bin/env bash
echo "Installing Language Tool server using brew" &&
brew install languagetool &&
echo "Starting Language Tool Service" &&
brew services start languagetool
# install the browser extension from: https://languagetool.org/#firefox_chrome
# Go to extension options > advanced > LanguageTool server > Select "Local server (localhost) - requires LanguageTool server running locally"
@eliocapelati
eliocapelati / git-alias.sh
Created November 18, 2022 18:26
Create a log line for visualizing commit log tree, ref:https://ma.ttias.be/pretty-git-log-in-one-line/
git config --global alias.logline "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@eliocapelati
eliocapelati / download_audios.sh
Created March 17, 2022 12:53
Download audio files of book IELTS, 4th Edition freely available on: https://barronsbooks.com/tp/ielts/audio/index_d83rd2.html
#!/usr/bin/env bash
## Download audio files of book:
## IELTS, 4th Edition
## freely available on: https://barronsbooks.com/tp/ielts/audio/index_d83rd2.html
# https://barronsbooks.com/tp/ielts/audio/d83rd2/Track%2001.mp3
@eliocapelati
eliocapelati / definition.yaml
Created October 27, 2021 20:30
Team definition
openapi: '3.0.0'
info:
title: API Teams
version: '1.0'
description: API for managing Teams
contact:
name: Elio Capelati Junior
email: [email protected]
servers:
- url: 'http://localhost:8080/v1'
import time
def recursive_fib_memo(val, memo):
if val <= 1:
return val
elif val not in memo:
memo[val] = recursive_fib_memo(val - 2, memo) + recursive_fib_memo(val - 1, memo)
return memo[val]
@eliocapelati
eliocapelati / bluetooh_defibrillator.sh
Created February 18, 2021 13:22
Restart bluetooh service on Mac
#!/bin/bash
sudo launchctl stop com.apple.bluetoothd
sudo launchctl start com.apple.bluetoothd