Skip to content

Instantly share code, notes, and snippets.

View glaucocustodio's full-sized avatar
🇧🇷

Glauco Custódio glaucocustodio

🇧🇷
View GitHub Profile
This uses llm.datasette.io and OpenAI.
I use `git commit --template` to provide the output from the LLM to Git. This way, if you do not like the results, you
can quit your editor and no commit will be made.
# Shell function for generating a diff and editing it in your default editor:
gcllm() {
GIT_DIR="$(git rev-parse --git-dir)"
TEMPLATE="$GIT_DIR/COMMIT_EDITMSG_TEMPLATE"
@dbieber
dbieber / fastbook.py
Last active August 10, 2023 18:13
fastbook speeds up the silence in audiobooks, and can speed up the non-silence too
"""Performs automatic speed edits to audio books.
Example usage:
Assuming you have an audiobook book.aax on your Desktop:
1. Convert it to wav:
ffmpeg -i ~/Desktop/book.aax ~/Desktop/book.wav
2. Adjust the speed:
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active April 26, 2024 18:53
crack activate Office on mac with license file
@primaryobjects
primaryobjects / react-confirm.js
Created November 1, 2017 19:03
A simple example of a confirm alert dialog in ReactJs / React.
<div className='delete-button' onClick={() => { if (window.confirm('Are you sure you wish to delete this item?')) this.onCancel(item) } } />
@bl4ck5un
bl4ck5un / responsive-semantic-ui.css
Created May 12, 2017 03:20
Responsive helpers (mobile-only etc.) for semantic-ui
/* Semantic UI has these classes, however they're only applicable to*/
/* grids, containers, rows and columns.*/
/* plus, there isn't any `mobile hidden`, `X hidden` class.*/
/* this snippet is using the same class names and same approach*/
/* plus a bit more but to all elements.*/
/* see https://github.com/Semantic-Org/Semantic-UI/issues/1114*/
/* Mobile */
@media only screen and (max-width: 767px) {
[class*="mobile hidden"],
@fimkap
fimkap / gist:565d97a6a57a7b9283c8663ae8c9eab1
Created January 12, 2017 09:25
NeoVim, FZF and termpix setup
install termpix from https://github.com/fimkap/termpix (currently alpha blending done with white background)
-- init.vim (along with usual FZF setup, change path to termpix)
let g:fzf_layout = { 'down': '~60%' }
let g:fzf_files_options =
\ '--preview "(~/dev/termpix/bin/termpix --width 50 --true-color {} || cat {}) 2> /dev/null "'

Crystal vs Node.js Websocket Benchmark

Crystal 0.9.1 with Kemal

require "kemal"

ws "/" do |socket|
  socket.on_message do |message|
 end
Pry.config.editor = "vim --noplugin"
if defined?(PryByebug)
Pry.commands.alias_command 'c', 'continue'
Pry.commands.alias_command 's', 'step'
Pry.commands.alias_command 'n', 'next'
Pry.commands.alias_command 'f', 'finish'
Pry.commands.alias_command 'b', 'break'
Pry.commands.alias_command 'bda', 'break --disable-all'
end
@hotchpotch
hotchpotch / .pryrc
Created March 5, 2012 13:26
pry clipboard copy utility
def pbcopy(str)
IO.popen('pbcopy', 'r+') {|io| io.puts str }
output.puts "-- Copy to clipboard --\n#{str}"
end
Pry.config.commands.command "hiscopy", "History copy to clipboard" do |n|
pbcopy _pry_.input_array[n ? n.to_i : -1]
end
Pry.config.commands.command "copy", "Copy to clipboard" do |str|
@jbjornson
jbjornson / SwitchToFile.py
Last active October 29, 2015 19:45
Show a input panel to switch to a currently open file
import sublime_plugin
import os
# -------------------------------------------
# You will need to create a key mapping for this, something like:
# { "keys": ["alt+e"], "command": "switch_to_file" }
# -------------------------------------------
class SwitchToFileCommand(sublime_plugin.WindowCommand):
def run(self):
self.display_list = []
self.views = []