Skip to content

Instantly share code, notes, and snippets.

@grey-code
grey-code / gist:5070286
Created March 2, 2013 09:27
AutoHotkey: SC_CutWindow
; I added a feather field instead of a new func.
Gui, Show, w500 h500
; By: Sjc1000
; http://www.autohotkey.com/board/topic/90132-class-sc-cutwindow-easily-cut-windows-into-shapes/
Class SC_CutWindow
{
Square( Window_Name, X1, Y1, X2, Y2, Feather, Invert)
{ If ( X1 > X2 || Y1 > Y2 )
Return 1
@grey-code
grey-code / gist:5065483
Created March 1, 2013 15:43
AutoHotkey: LV_MoveRow()
LV_MoveRow(up=true) {
if (up && LV_GetNext() == 1)
|| (!up && LV_GetNext() == LV_GetCount())
|| (LV_GetNext() == 0)
return
pos := LV_GetNext()
, xpos := up ? pos-1 : pos+1
Loop,% LV_GetCount("Col") {
@grey-code
grey-code / gist:4728599
Created February 7, 2013 04:38
AutoHotkey: inObj
inObj(obj, ss, cs:=false, bv:=true) {
r := false
if (!cs && !bv)
return ObjHasKey(obj, ss)
for a, b in obj
if (r := !r ? (cs ? (ss == (bv ? b : a)) : (ss = b)) : r)
break ; stop loop if found
return r ? a : r
}
@grey-code
grey-code / gist:4728561
Created February 7, 2013 04:33
AutoHotkey: SetButtonF [Single]
/*
_________________________________________________________________________________________
FUNCTION: SetButtonF
DESCRIPTION: Set a button control to call a function instead of a label subroutine
PARAMETER(s):
hButton := Button control's handle
FunctionName := Name of fucntion to associate with button
USAGE:
Setting a button:
@grey-code
grey-code / ahkexec.py
Last active December 12, 2015 06:19
Python: Run/build AHK code [ST2 Plugin]
import sublime, sublime_plugin
import subprocess
import re
from ctypes import *
class ahkexec(sublime_plugin.TextCommand):
# SET YOUR SETTINGS HERE
# Specify a 'key'(name it whatever you want) and assign it
# a 'value'(string) containing the path to the AHK executable.