Skip to content

Instantly share code, notes, and snippets.

View runekaagaard's full-sized avatar

Rune Kaagaard runekaagaard

  • Copenhagen, Denmark
View GitHub Profile
@arctic-hen7
arctic-hen7 / whisper_transcribe.py
Created July 17, 2023 01:12
A Python script that records audio from the microphone into a temporary file until the user presses Enter, and that then transcribes that audio using Whisper. A plug-and-play way of adding voice non-real-time voice command to Python apps!
import whisper
import pyaudio
import wave
import sys
import tempfile
from ctypes import *
# Load the Whisper model once
model = whisper.load_model("base.en")
@johnboxall
johnboxall / jquery.type.js
Created September 4, 2011 02:40
For when you _really_ wanna change the type of a input with jQuery
var rtype = /^(?:button|input)$/i;
jQuery.attrHooks.type.set = function(elem, value) {
// We can't allow the type property to be changed (since it causes problems in IE)
if (rtype.test(elem.nodeName) && elem.parentNode) {
// jQuery.error( "type property can't be changed" );
// JB: Or ... can it!?
var $el = $(elem);
var insertionFn = 'after';