Skip to content

Instantly share code, notes, and snippets.

View Versatilus's full-sized avatar

Eric Paulson Versatilus

  • Roseburg, Oregon, USA
View GitHub Profile
@Versatilus
Versatilus / reboot_speech.cmd
Created September 5, 2015 07:14
Method for rebooting speech recognition engines in case of catastrophic failure.
@echo off
setlocal
if not defined NATSPEAK_PATH call :finddragon
if not defined NATSPEAK_PATH (
echo Unable to find natspeak.exe. if you are using Dragon NaturallySpeaking please set the environment variable NATSPEAK_PATH to point to your natspeak.exe and try again.
set WSR=1
goto :kill
)
@Versatilus
Versatilus / keyboard.py
Created September 16, 2015 01:09
Custom alterations to Typeable class in Dragonfly's keyboard.py
#
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@Versatilus
Versatilus / atom.py
Last active March 20, 2018 17:34
Processed by Yapf
"""
__author__ = 'LexiconCode'
Command-module for Atom
Official Site "https://atom.io/"
"""
from caster.lib import control, settings
from caster.lib.dfplus.additions import IntegerRefST
from caster.lib.dfplus.merge import gfilter
from caster.lib.dfplus.merge.mergerule import MergeRule
from caster.lib.dfplus.state.short import R
@Versatilus
Versatilus / gist:4dd0fd77d8140dfea24816b611c38fc9
Created April 14, 2018 23:30 — forked from anvaka/gist:3815296
JavaScript Function Serialization
function functionReplacer(key, value) {
if (typeof(value) === 'function') {
return value.toString();
}
return value;
}
function functionReviver(key, value) {
if (key === "") return value;
@Versatilus
Versatilus / text_patch.py
Last active May 20, 2018 18:44
Adaptation of Dragonfly's Text action to use Unicode keyboard emulation for use with Caster.
# -*- coding: utf-8 -*-
#
# This file uses code from and is intended to replace the Text Action class
# distributed as part of Dragonfly.
# (c) Copyright 2018 by Eric Lewis Paulson
# with portions
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
[
{
"name": "Pink",
"hex": "ffc0cb",
"rgb": "255,192,203"
},
{
"name": "LightPink",
"hex": "ffb6c1",
"rgb": "255,182,193"
@Versatilus
Versatilus / Dragonfly_Basics.md
Created December 22, 2018 17:34
Dragonfly Basics

The most common type of grammar is a MappingRule (or MergeRule in Caster). It is built from three variables:

  • a mapping dictionary
  • an extras list
  • and an optional defaults dictionary.

A mapping maps a specially formatted spoken phrase to some Action class, usually some combination of Key, Text, or Function.

A spoken phrase is usually some combination of the following:

  • literal spoken text
  • alternatives separated by | and grouped by ()
@Versatilus
Versatilus / _chrome_personal.py
Created May 5, 2019 12:09
Personal speech recognition (Dragonfly) command set for Google Chrome
#!python
# -*- coding: utf-8 -*-
"""
This is relevant as of 20190505. I have no plans of updating this gist. Some of
this is written in a style I wouldn't necessarily use now, but I'll let you
guess what that is.
I'm not going to bet that any of this works. I haven't updated it in months, if
not years. I know that some of the Facebook commands don't work. I use most of
from __future__ import print_function, unicode_literals
from ctypes import windll
from dragonfly import (ActionBase, Choice, Grammar, IntegerRef, Key,
MappingRule, Mouse, Pause, Repeat)
from dragonfly.actions.keyboard import Keyboard, KeySymbols
KEYBOARD = Keyboard()
# -*- coding: utf-8 -*-
# Author: Eric Lewis Paulson (Versatilus)
# License: Public Domain
# except`url_fix` adapted from werkzeug
# see https://github.com/pallets/werkzeug/blob/master/LICENSE.rst
# Version: 20200109-001525 (-8 UTC)
r"""
A simple set of voice commands for mangling text with the clipboard.