Skip to content

Instantly share code, notes, and snippets.

View emdeeeks's full-sized avatar

Gareth Griffiths emdeeeks

View GitHub Profile

Whisper.cpp on Ubuntu — install + build + “Dictate Toggle” hotkey

This guide installs whisper.cpp on Ubuntu and sets up an English push-to-talk toggle:

  • Press hotkey once → start recording
  • Press hotkey again → stop → transcribe → paste at cursor

It’s written to work for most Ubuntu machines. GPU is optional.


@KonnorRogers
KonnorRogers / dungeon.rb
Created September 14, 2025 01:14
shadowcasting
module Dungeon
# Multipliers for transforming coordinates into other octants
MULT = [
[1, 0, 0, -1, -1, 0, 0, 1],
[0, 1, -1, 0, 0, -1, 1, 0],
[0, 1, 1, 0, 0, -1, -1, 0],
[1, 0, 0, 1, -1, 0, 0, -1],
]
# Determines which co-ordinates on a 2D grid are visible
@amirrajan
amirrajan / 00_preview.md
Created August 6, 2025 21:54
DragonRuby Game Toolkit - Rinoa Final Fantasy 8
riona-720p.mp4
@KonnorRogers
KonnorRogers / dr.rb
Last active December 17, 2025 16:39
Label wrapping
# Sample from:
# https://docs.dragonruby.org/#/samples/rendering-basics?id=labels-text-wrapping-mainrb
def tick(args)
lines = ["line1", "line2", "line3", "line4"]
labels = lines.map.with_index do |text, index|
{
x: 1280 / 2,
y: 720 / 2,
text: text,
anchor_y: index
@danielbodart
danielbodart / whisper.sh
Last active March 4, 2026 17:12
A simple script using whisper.cpp to dictate into any input box on X11
#!/bin/bash
# Whisper Push-to-Talk Dictation Tool
# Runs whisper.cpp continuously, only processes output when key is held
set -euo pipefail
# Get script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@amirrajan
amirrajan / main.rb
Created June 18, 2025 06:41
DragonRuby Game Toolkit - Fifteen Puzzle Game version 2.0
class Game
attr_gtk
def initialize
# rng is sent to Random so that everyone gets the same levels
@rng = Random.new 100
@solved_board = (1..16).to_a
# rendering size of the cell
@amirrajan
amirrajan / shared_controller.rb
Created June 7, 2025 00:05
two controllers, one game
class SharedKeyDown
attr :args
def inputs
@args.inputs
end
def start
inputs.controllers.any? { |c| c.key_down.start }
end
@amirrajan
amirrajan / main.rb
Last active June 9, 2025 22:56
camera with rotation matrix and circle based collision
class Game
attr_gtk
def initialize
@player = { x: 30,
y: -16,
w: 32,
h: 32,
dx: 0,
dy: 0,
@debugdynamocoder
debugdynamocoder / comments.md
Last active March 4, 2026 17:09
My Script for STT

Script Purpose:

This script transcribes audio into text using either a remote Groq API or a local Whisper.cpp model based on user input. Triggered via keybindings, it supports multiple languages.

Keybindings:

  • whpr → Recognize audio in English.
  • whpr fr → Recognize audio in French.
  • whpr es → Recognize audio in Spanish.
  • whpr lang → Recognize audio in any supported language.

Workflow:

@amirrajan
amirrajan / main.rb
Last active June 9, 2025 23:01
DragonRuby Game Toolkit: Slay the Card Game Example
class Game
attr_gtk
attr :enemy
def tick
defaults
calc
render
end