Skip to content

Instantly share code, notes, and snippets.

; probe z-
g92 z0 ; set current position as temporary origin
g91 ; relative positioning
g38.2 z-20 f50 ; probe z
g92 z0 ; set current position as z0
g0 z2 f480 ; back off of work
; probe x+
g91 ; relative positioning
g38.2 x50 f100 ; probe x0 (remember to account endmill radius afterwards)
@echo off
start /d "C:\Program Files (x86)\AlphaConsole" AlphaConsole.exe
timeout /t 1
start steam://rungameid/252950
timeout /t 1
@mzizzi
mzizzi / aenea_server_core.py
Created February 14, 2016 16:00
Possible aenea server abstractions
import abc
import time
import logging
class AeneaServer(object):
"""
AeneaServer is a jsonrpc server that exposes emulated keyboard/mouse input
over the network.
"""
@mzizzi
mzizzi / bench_keys.py
Created November 14, 2015 19:58
benchmark key presses on from aenea client to server
from aenea.wrappers import ensure_execution_context
from aenea import Key
import time
time.sleep(5)
# get context ahead of time so our timing is more accurate
DATA = ensure_execution_context({})
def press_separate():
@mzizzi
mzizzi / benchmark_get_context.py
Created November 13, 2015 00:38
compare get_context implementations
"""
Drop this script into ./server/linux_x11/ and run it to compare get_context
implementations!
pip install -e 'git+https://github.com/rshk/python-libxdo.git#egg=python-libxdo'
pip install python-xlib
pip install psutil
In my ubuntu machine I needed the following package...
sudo aptitude install libX11-dev
@mzizzi
mzizzi / x11_events.py
Created November 12, 2015 01:15
Subscribe to X11 PropertyChange events
"""
Subscribe to X11 PropertyChange events and print "Window Changed!" when a
_NET_ACTIVE_WINDOW property has been changed.
Unfortunately no event is received events when _NET_WM_NAME is changed so this
would only partially solve https://github.com/dictation-toolbox/aenea/issues/103
You'll have to `pip install python-xlib` to run this script.
(Tested with the Cinnamon 2.2.16 desktop)
import sys
sys.path.append('c:\NatLink\NatLink\MacroSystem')
import time
import aenea
from aenea import Text
from aenea.wrappers import ensure_execution_context
class BatchTextActionExecutor(object):
def __init__(self):
self.batch = []
import asyncio
import threading
import time
class MyBlockingSubscription(object):
def __init__(self, handler):
super().__init__()
self.handler = handler