Skip to content

Instantly share code, notes, and snippets.

View hoppfrosch's full-sized avatar

hoppfrosch hoppfrosch

  • Hesse, Germany
View GitHub Profile
@hoppfrosch
hoppfrosch / Class_RegEx.ahk
Created March 25, 2014 11:26
RegEx Class #ahk #class
/*
Created by Frankie Bagnardi
Forum topic: http://www.autohotkey.com/forum/topic74340.html
Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
v0.5
Modified by R3gX - http://www.autohotkey.com/board/topic/69236-regex-class/page-2#entry582249
*/
class RegEx
@hoppfrosch
hoppfrosch / URIEncode.ahk
Created January 27, 2014 10:39
URIEncode / URIDecode #ahk #function
; By Jackieku - http://www.autohotkey.com/board/topic/35660-url-encoding-function/
; JavaScript encodeURI()
URI_Encode(sURI, sExcepts = "!#$&'()*+,-./:;=?@_~")
{
Transform sUTF8, ToCodePage, 65001, %sURI%
origFmt := A_FormatInteger
SetFormat IntegerFast, hex
sResult := ""
Loop
@hoppfrosch
hoppfrosch / WakeUp.ahk
Created January 6, 2014 12:26
AHK wake-up-timer #ahk #script #function
; AHK wake-up-timer
; scheduler provides some of the functions of Window's Task Scheduler or the command line tool "schtasks" as an AHK-script.
; Unlike Windows' Scheduled Tasks this function works with accounts without passwords
;
; Author: boskoop (http://http://www.autohotkey.com/board/topic/10587-wake-up-timer-scheduler-function)
; CONFIGURATION
Year=2006
Month=8 ;1-12
Day=30 ;1-31
@hoppfrosch
hoppfrosch / CallStack.ahk
Created November 27, 2013 07:45
Get the current AHK-callstack #ahk #script #function #debug
CallStack(deepness = 5, printLines = 1)
{
loop % deepness
{
lvl := -1 - deepness + A_Index
oEx := Exception("", lvl)
oExPrev := Exception("", lvl - 1)
FileReadLine, line, % oEx.file, % oEx.line
if(oEx.What = lvl)
continue
@hoppfrosch
hoppfrosch / JSON.ahk
Created November 18, 2013 06:22
JSON Utilities for AutoHotkey #ahk #script #function #json
/*
Title: JSON
JSON Utilities for AutoHotkey
Details:
Internally the ActiveX Control "Windows Script Control " (http://www.microsoft.com/de-de/download/details.aspx?id=1949) is used by those functions
Author:
Compilation by hoppfrosch; Original work by Wicked and tmplinshi
@hoppfrosch
hoppfrosch / NamedParameters.ahk
Created October 9, 2013 11:21
Named functions parameters using variadic and JSON-Syntax #ahk #script #snippet
; Named parameters for functions
;
; Credits: named parameters by lexikos (http://www.autohotkey.com/board/topic/62504-variadic-functions)
; Note the Brackets around the parameters and the trailing star {...}*!!! (Brackets: JSON - Star: Variadic ...)
Test({WinTitle: "ahk_class Notepad", ExcludeTitle: "Untitled", Cmd: "PID"}*)
Test2({WinTitle: "ahk_class Notepad", ExcludeTitle: "Untitled2", Cmd: "PID2"}*)
; Simple Variadic: All parameters are accesible through prms-Array
Test(prms*) {
@hoppfrosch
hoppfrosch / NumifyVersion.ahk
Last active April 4, 2016 06:18
Conversion of a version given as string to a numerical version (to allow version comparison) #ahk #script #function
; Conversion of a version given as string to a numerical version (to allow version comparison)
;
; see: http://www.autohotkey.com/board/topic/62037-conversion-of-version-string-to-number/
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Example: Does current AHK-Version meet my requirements?
; Which version of Autohotkey is required?
versionAHKReq := "1.0.90.0"
vAHKCurr := NumifyVersion(A_AhkVersion)
vAHKReq := NumifyVersion(versionAHKReq)
@hoppfrosch
hoppfrosch / ChristianFeasts.ahk
Last active October 26, 2017 05:03
DateTime - Functionality #ahk #script #function #lib
; Calculating date of christian easter and subsequent christian feasts
;
; The following feasts are calculated:
; * Christian Easter
; * Ash Wednesday
; * Ascension Day
; * Whitsunday
; * Corpus Christi
;
; Author: hoppfrosch @ hoppfrosch@gmx.de
@hoppfrosch
hoppfrosch / WMI_GetProcessInformation.ahk
Created September 26, 2013 06:45
Get information about running processes using WMI #ahk #script #function #wmi #com
; Description: Get Process properties via AHK using WMI
;
; Author: hoppfrosch - 20140206
;
; Credits
; * http://technet.microsoft.com/en-us/library/ee176712.aspx (by MSDN)
; * http://msdn.microsoft.com/en-us/library/windows/desktop/aa394372%28v=vs.85%29.aspx
; * http://http://www.autohotkey.com/board/topic/90385-drei-kleine-fragen (by Rohwedder)
; * http://www.autohotkey.com/board/topic/72817-how-to-obtain-%E2%80%9Cuser-name%E2%80%9D-from-running-processes/#entry465606 (by Lexikos)
PropertyList := "Caption,CommandLine,CreationClassName,CreationDate,CSCreationClassName,CSName,Description,ExecutablePath,"
@hoppfrosch
hoppfrosch / AHK_version.ahk
Created September 11, 2013 05:18
Determine version of Autohothey #ahk #script #snippet
;shows what version of ahk the user is running
; i think sinkfaze might have come up with this originally (dist. by camerb)
info := "AutoHotkey:`t" "AutoHotkey" ((A_AhkVersion < 1.1) ? " Classic ": ((A_IsDll ? "_H (DLL)":"_L")))
. "`nAHK Version:`t" A_AhkVersion
. "`nUnicode:`t`t" (A_IsUnicode ? "Yes " ((A_PtrSize=8) ? "(64-bit)" : "(32-bit)") : "No")
. "`nOperating System:`t" (!A_OSVersion ? A_OSType : A_OSVersion) " " (A_Is64bitOS ? "(64-bit)" : "(32-bit)")
. "`nAdmin Rights:`t" (A_IsAdmin ? "Yes" : "No")
MsgBox, 68, Support Information, %info%`n`nWould you like to copy this information to the Clipboard?
IfMsgBox Yes