Skip to content

Instantly share code, notes, and snippets.

@G33kDude
G33kDude / EasyStreamDeck.ahk
Created March 12, 2022 19:20
Launch AutoHotkey code from a StreamDeck efficiently using GET requests
#NoEnv
#Persistent
SetBatchLines, -1
#Include <Socket>
/*
Launch AutoHotkey code from a StreamDeck efficiently using GET requests
@G33kDude
G33kDude / life.ahk
Last active February 28, 2022 00:00
Game of Life for Discord competition
#Include precode.ahk
global W=20,H=20,b=[]
OnCellAlive(x,y){
OnCellDead(x,y,1)
}OnCellDead(x,y,n=0){
SetCell(x,y,b[x,y]:=n)
}SetupBoard(W,H)
r::
i:=0,c=[]
while i<W*H,n=-s:=b[x:=mod(i,W),y:=i++//W],j=0{
FROM php:7.3-apache
RUN docker-php-ext-install mysqli
# Use the default production configuration
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
# Path to search for mysql UNIX socket
RUN echo "mysqli.default_socket=/var/run/mysqld/mysqld.sock" >> $PHP_INI_DIR/php.ini
# Allow short open tags
@G33kDude
G33kDude / synaptics.ahk
Last active January 10, 2021 20:36
Synaptics Touchpad Toggle
; 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
#NoEnv
SetBatchLines, -1
map := FileOpen(A_Desktop "\day3.txt", "r").Read()
map := StrSplit(map, "`n", "`r")
; --- Part 1 ---
for y, row in map
#NoEnv
SetBatchLines, -1
#Include <Socket>
MATRIC_CONFIG_PATH := A_Desktop "\..\Documents\.matric\config.json"
APP_NAME := "AutoHotkey"
API_PORT := 50300
RESP_PORT := 50301
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
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

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