Skip to content

Instantly share code, notes, and snippets.

View scpedicini's full-sized avatar

Shaun Pedicini scpedicini

View GitHub Profile
@scpedicini
scpedicini / transcribe.py
Last active September 21, 2024 21:14
Python Dictation Transcription Application
# This script will transcribe an audio file (mp3, wav, etc.) to text and then clean the text using a local LLM model.
# GETTING STARTED:
# 1. Install openai
# 2. Git clone a copy of ggerganov/whisper (https://github.com/ggerganov/whisper.cpp)
# 3. Build the whisper binary
# 4. Download the whisper model (largev2 is the most accurate for all languages, though the base model works pretty well for English).
# 5. Install ffmpeg
# 6. Install ollama (https://ollama.com/download)
# 7. Download an LLM model (https://ollama.com/library)
@scpedicini
scpedicini / brew.md
Created September 3, 2022 22:18 — forked from pudquick/brew.md
Lightly "sandboxed" homebrew on macOS

brew is a bad neighbor

This isn't a guide about locking down homebrew so that it can't touch the rest of your system security-wise.

This guide doesn't fix the inherent security issues of a package management system that will literally yell at you if you try to do something about "huh, maybe it's not great my executables are writeable by my account without requiring authorization first".

But it absolutely is a guide about shoving it into its own little corner so that you can take it or leave it as you see fit, instead of just letting the project do what it likes like completely taking over permissions and ownership of a directory that might be in use by other software on your Mac and stomping all over their contents.

By following this guide you will:

  • Never have to run sudo to forcefully change permissions of some directory to be owned by your account
@scpedicini
scpedicini / logger.js
Last active September 19, 2021 22:18
Sqlite3 Winston Logger
// requirements
const winston = require('winston');
const winstonSqlite3Transport = require('./winston-sqlite3-transport');
class Logger {
winstonLogger;
constructor(db_file) {
this.winstonLogger = winston.createLogger({
level: 'debug',
@scpedicini
scpedicini / safeparse.js
Created December 20, 2020 18:12
Convert a JSON string into a standard javascript object
/**
* Convert a JSON string into a standard Javascript Object
* @param x - JSON string
* @returns {{}} - Deserialized object or empty object
*/
static SafeParse(x) {
let obj = { };
try
{
if(x !== null && x !== undefined)
@scpedicini
scpedicini / block.js
Last active December 20, 2020 18:06
Block CPU
/**
* Simple CPU-bound blocking operation for testing purposes
* @param baseNumber - higher the value, the longer the operation will block
*/
static blockCPU(baseNumber) {
console.time('blockCPU');
let result = 0;
for (let i = Math.pow(baseNumber, 7); i >= 0; i--) {
result += Math.atan(i) * Math.tan(i);
}