Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
# Copyright (C) 2016, jaggz.h {who is at} gmail.com
# If you look or use this code, any further than this and the following line,
# you agree to all the terms and conditions outlined below in code.
# Otherwise, it's free to use, but if you make money off it, you must submit
# to me your first-born child.. nevermind. I don't want it. Go ahead
# and use it (the code) however you wish; I wish you well in life.
# gist-paste -u https://gist.github.com/jaggzh/70c77cf1959c2cc41f2eeee2c7e0541f
use strict;
use warnings;
#!/bin/bash
# Return (print) the name of the last file in the current dir
# by jaggz.h {who is at} gmail.com
# CC0
#
# gist url:
# https://gist.github.com/jaggzh/835dc4d235cdeafd261b3a3f2769636e
#
# To use in shell conveniently you can bind a key to it (I use ^B)
#
#!/usr/bin/perl
# gist url:
# gist-paste -u https://gist.github.com/jaggzh/218c2640f87a414854d262a5e127ed95
use strict;
use warnings;
use Device::SerialPort;
use Getopt::Std;
use Time::HiRes qw(time sleep);
#!/usr/bin/env python3
# gist-paste url:
# gist-paste -u https://gist.github.com/jaggzh/6e3d4d97fa93aa76320ea7b389140ff0
from transformers import WhisperProcessor, WhisperForConditionalGeneration
from datasets import load_dataset
# This is the directory created by run_speech_recognition_seq2seq.py
whdir="whisper-custom-en"
# NOTE! For loading large datasets, like common-voice, seq2seq's hf mozilla commonvoice loader (at least for v11)
#!/usr/bin/perl
# CC-By 2023 jaggz.h {over at} gmail.com
# https://github.com/jaggzh/
#
# Gist URL:
# https://gist.github.com/jaggzh/b76b555afc8143935bd5b365bf53143d
#
# Outputs values for command-line provided resistances or temperatures
# Usage: therm [options] <values> [options]
# eg: therm <resistance>k [<resistance2>k ...]
#!/usr/bin/env python3
import sys
import sqlite3
import csv
import argparse
import re
from datetime import datetime
def pe(*x, **y): print(*x, *y, file=sys.stderr)
def pf(*x, **y): print(*x, *y, flush=True)
#!/usr/bin/env python
# gist-paste -u https://gist.github.com/jaggzh/5c345fc072ddf5a6199ba19ac6112001
import numpy as np
import matplotlib.pyplot as plt
from audioproc import *
from utils import *
import matplotlib.pyplot as plt
import matplotlib.animation as animation
def plot_find_peaks(energy, *, num_peaks, winsize):
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
from audioproc import *
from utils import *
import matplotlib.pyplot as plt
import matplotlib.animation as animation
def plot_find_peaks(energy, *, num_peaks, winsize):
"""
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
import sys
from audioproc import *
def find_peaks(energy, *, num_peaks, winsize):
en_len = len(energy)
spacing = en_len // num_peaks
cands = np.arange(spacing, en_len - spacing, spacing)
#!/bin/bash
# by jaggz.h {who is over at} gmail.com
# CC-BY. Reference my email or Jaggz Tech @ Youtube
# gist-paste -u https://gist.github.com/jaggzh/040778fe4260f19ad35dce0fa083e523
defmodel=e # Default model from models=() array below
blank_line_delay=.3 # Not sure if this works for other systems' sleep commands