This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FIXED_MINIAUDIO_URL=" | |
https://raw.githubusercontent.com/mackron/miniaudio/fe5f17ecf3189c680855b030467bcfa9f8d26143/miniaudio.h" | |
curl -L $FIXED_MINIAUDIO_URL -o src/external/miniaudio.h | |
mkdir -p build | |
cd build | |
cmake \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i ~/Desktop/input.m4a -ar 16000 ~/Desktop/input.wav | |
pip install ane_transformers | |
pip install openai-whisper | |
pip install coremltools | |
gclone ggerganov/whisper.cpp | |
make clean | |
cmake -B build -DWHISPER_COREML=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl http://localhost:11434/api/generate -d '{ | |
"model": "llava:v1.6", | |
"prompt": "What is in this picture?", | |
"images": ["'"$(base64 --input my_image.jpeg)"'"] | |
}' | |
curl http://localhost:11434/api/generate -d '{ | |
"model": "llava:v1.6", | |
"prompt": "Extract all the text in this picture", | |
"stream": false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/a/44672195/3013522 | |
git reset --soft HEAD~1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On the remote server: | |
mkdir -p /home/username/repositories/my-repo.git | |
cd /home/wsilva/repositories/my-repo.git | |
git init --bare | |
On my machine: | |
git remote add git remote add origin username@hostname:/home/wsilva/repositories/my-repo.git | |
git push origin master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from https://bradgessler.com/articles/rename-a-rubygem/ | |
require 'pathname' | |
require 'fileutils' | |
class GemRename | |
def initialize(base_dir = ".") | |
@base_dir = Pathname.new(base_dir) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creates a directory called username in the github folder, clones the repo and cd's into the repo | |
# Add it to .zshrc | |
# requires gh, wd and a warp point called 'github' | |
# wd: https://github.com/mfaerevaag/wd | |
# gh: https://cli.github.com | |
# Usage: gclone username/repo | |
gclone() { | |
if [ -z "$1" ]; then | |
echo "Usage: gclone <username/repo>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby -run -e httpd . -p 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math'; | |
const _characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; | |
const _length = 28; | |
String createFirestoreId() { | |
return List.generate(_length, _randomCharacter).join(); | |
} | |
String _randomCharacter(_) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script will describe the code of a Flutter app | |
# Get the path to the Flutter app | |
app_path=$(pwd)/lib | |
# Navigate to the app directory | |
cd $app_path |
NewerOlder