Skip to content

Instantly share code, notes, and snippets.

@G33kDude
G33kDude / synaptics.ahk
Last active Jan 10, 2021
Synaptics Touchpad Toggle
View synaptics.ahk
; Script to turn the Synaptics Touchpad on and off. Useful for laptops with
; Synaptic touchpads that do not have dedicated touchpad on/off buttons. I use
; this code to quickly toggle on and off the touchpad on my Lenovo Thinkpad,
; where I primarily use the TrackPoint.
; API Reference
; https://autohotkey.com/board/topic/65849-controlling-synaptics-touchpad-using-com-api/page-2#entry416712
; Constants
View day3.ahk
#NoEnv
SetBatchLines, -1
map := FileOpen(A_Desktop "\day3.txt", "r").Read()
map := StrSplit(map, "`n", "`r")
; --- Part 1 ---
for y, row in map
View MATRIC.ahk
#NoEnv
SetBatchLines, -1
#Include <Socket>
MATRIC_CONFIG_PATH := A_Desktop "\..\Documents\.matric\config.json"
APP_NAME := "AutoHotkey"
API_PORT := 50300
RESP_PORT := 50301
View Print.ahk
Print(obj, quote:=False, end:="`n")
{
static cout:=FileOpen("*", "w")
, escapes := [["``", "``" "``"], ["""", """"""], ["`b", "``b"]
, ["`f", "``f"], ["`r", "``r"], ["`n", "``n"], ["`t", "``t"]]
if IsObject(obj)
{
for k in obj
is_array := k == A_Index
until !is_array
View Gson.ahk
Gson_Window()
{
static dom, window
if window
return window
dom := ComObjCreate("htmlfile")
dom.write("<meta http-equiv='X-UA-Compatible'content='IE=edge'><script>
( Comment
View autohotkey_formatting.md

AutoHotkey Formatting Guidelines

Global Variables:

  • Should be constants, in ALL_CAPS
  • Or variables prefixed with _underscore

Constant values should be in ALL_CAPS other variables should be snake_case or camelCase

Functions and Methods should be PascalCase

@G33kDude
G33kDude / tooltips.py
Last active Mar 22, 2020
System wide tooltips using python 3
View tooltips.py
#!/usr/bin/env python3
import time
import ctypes
from ctypes import wintypes
import struct
import threading
# --- Windows API Setup ---
View calibre-web-proxy.md

Reverse Proxy Calibre-Web Container with Different Base URL

When using Calibre-Web from Docker, the most popular container doesn't offer an obvious way to set up a reverse proxy under a different base URL. It's simple to do by writing a request header in your reverse proxy config, as demonstrated below.

Apache