Skip to content

Instantly share code, notes, and snippets.

View jcsteh's full-sized avatar

James Teh jcsteh

View GitHub Profile
@jcsteh
jcsteh / phoneexperiencehost.py
Created October 21, 2024 02:59
NVDA app module for Microsoft Phone Link
# Copyright 2024 James Teh
# License: GNU General Public License version 2.0
"""App module for Phone Link.
This does the following:
1. Works around the Phone Link crash when tabbing into the messages list.
2. Makes alt+1 focus the Conversations list when the Conversations view is
already active. Without this, alt+1 does nothing in this case. This makes it
much easier to switch conversations.
3. Adds alt+d to focus the message input text box. This is useful if you've
@jcsteh
jcsteh / logger.py
Created August 29, 2023 06:42
An NVDA synth driver which logs time stamped speech output.
import os
import time
from collections import OrderedDict
import wx
import synthDriverHandler
from synthDriverHandler import synthIndexReached, synthDoneSpeaking
from speech.commands import IndexCommand
import globalVars
class SynthDriver(synthDriverHandler.SynthDriver):
@jcsteh
jcsteh / spinCpu.cpp
Created February 10, 2022 05:38
Spin all threads of a CPU.
/*
* spinCpu: Spin all threads of a CPU.
* This is useful for testing how things behave when the CPU is fully utilised.
* Copyright 2022 James Teh
* License: Mozilla Public License version 2.0
*/
#include <iostream>
#include <thread>
#include <vector>
@jcsteh
jcsteh / playPauseMultiFunction.ahk
Last active October 24, 2023 13:03
AutoHotkey script to make the play/pause button on headsets skip to next/previous track when double/triple pressed
; Play/Pause Multi Function
; Copyright 2022 James Teh
; License: GNU General Public License
#SingleInstance Force
; Ensure we don't intercept our own sending of play/pause.
#If (!sendingPlayPause)
Media_Play_Pause::
{
@jcsteh
jcsteh / SiriInteractiveReader.js
Created August 24, 2021 11:11
iOS Scriptable script to allow line by line reading of text with Siri and/or Apple Watch
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-purple; icon-glyph: magic;
// Author: James Teh <[email protected]>
// Copyright 2021 James Teh
// License: GNU General Public License version 2.0
const fm = FileManager.iCloud();
const docs = fm.documentsDirectory();
@jcsteh
jcsteh / ZoomGlobalKeys.ahk
Last active March 23, 2020 22:51
AutoHotkey script to control Zoom with global keyboard shortcuts
; ZoomGlobalKeys.ahk:
; AutoHotkey script to control Zoom with global keyboard shortcuts
; Author: James Teh <[email protected]>
; Copyright 2017-2019 James Teh
; License: GNU General Public License version 2.0
#!m::
{
ControlSend, , !a, ahk_class ZPContentViewWndClass
Return
@jcsteh
jcsteh / SpotifyGlobalKeys.ahk
Last active April 9, 2025 13:51
AutoHotkey script to control Spotify with global keyboard shortcuts
; SpotifyGlobalKeys.ahk:
; AutoHotkey script to control Spotify with global keyboard shortcuts
; Author: James Teh <[email protected]>
; Copyright 2017-2018 James Teh
; License: GNU General Public License version 2.0
DetectHiddenWindows, On
; Get the HWND of the Spotify main window.
getSpotifyHwnd() {