Skip to content

Instantly share code, notes, and snippets.

View maul-esel's full-sized avatar

maul.esel maul-esel

View GitHub Profile
@maul-esel
maul-esel / Function.html
Created October 24, 2011 17:01
RichContent Examples
<!DOCTYPE html>
<html>
<head>
<title>test</title>
<style type='text/css'>
td {
padding: 10px
}
pre.Syntax {
background-color: #FFFFAA;
@maul-esel
maul-esel / generate-chm.ahk
Created November 26, 2011 16:03
files to dynamically generate a CHM for ahkbook
; requires latest AHK_L
#SingleInstance force
SetWorkingDir %A_ScriptDir%
; ============= config =============
build_dir := A_ScriptDir "\build"
user := "maul-esel"
; ==================================
@maul-esel
maul-esel / Example1.ahk
Created January 23, 2012 19:38
SaveHImage2File - standalone version
#NoEnv
#SingleInstance ignore
#Include SaveHImage2File.ahk
hIcon := DllCall("LoadIcon", "UPtr", 0, "UInt", 32513, "UPtr") ; load a system icon
result := SaveHImage2File(hIcon, A_Desktop "\test.ico", "icon") ; save the icon to a file
MsgBox % "finished: " . (result ? "succeeded" : "failed") ; report to user
hbmp := DllCall("LoadBitmap", "UPtr", 0, "UInt", 32745, "UPtr")
result := SaveHImage2File(hbmp, A_Desktop "\test.bmp", "bitmap") ; save the bitmap to a file
@maul-esel
maul-esel / SHQueryRecycleBin.ahk
Created February 12, 2012 11:39
SHQueryRecycleBin - Retrieves the size of the Recycle Bin and the number of items in it, for a specified drive or folder.
/*
Function: SHQueryRecycleBin
Retrieves the size of the Recycle Bin and the number of items in it, for a specified drive.
Parameters:
STR path - the path of the root drive on which the Recycle Bin is located. This parameter can contain a string formatted with the drive, folder, and subfolder names (C:\Windows\System...).
[byRef] INT64 outSize - receives the total size of all the objects in the specified Recycle Bin, in bytes.
[byRef] INT64 outNumber - receives the total number of items in the specified Recycle Bin.
Returns:
@maul-esel
maul-esel / AHKv2 Polygon.ahk
Created February 20, 2012 12:30
Polygon - calculate the coordinates of a polygon
/*
Function: Polygon
calculates the coordinates for a polygon
Parameters:
count - the number of corners the polygon should have
radius - the radius of the polygon
[opt, byRef] x - receives an array of the x-coordinates. Omit this if not needed.
[opt, byRef] y - receives an array of the y-coordinates. Omit this if not needed.
[opt] xoffset - an optional x-offset to add to the coordinates
@maul-esel
maul-esel / AHK-cmd.bat
Created March 3, 2012 12:58
A batch file to run AHK command line apps without compilation
:: RUN THIS SCRIPT TO EXECUTE AHK SCRIPTS FROM THE COMMAND LINE WITHOUT COMPILING.
:: do not show the actions done here in the window
@echo off
:: ================================== Config section ==================================
:: adjust these values
:: the path to the AutoHotkey.exe to be used:
@set AHK_PATH=%PROGRAMFILES%\AutoHotkey\AutoHotkey.exe
@maul-esel
maul-esel / LibA.ahk
Created June 18, 2012 15:39
idea for ALD #include modification
; this is part of the package
; ============== some random code ==========================
MsgBox
return
Labelc:
ExitApp
return
; ================ interesting part here ==================
@maul-esel
maul-esel / semver.ahk
Created June 19, 2012 18:28
semver AHK lib
semver_validate(version)
{
return !!RegExMatch(version, "^(\d+)\.(\d+)\.(\d+)(\-([0-9A-Za-z\-]+\.)*[0-9A-Za-z\-]+)?(\+([0-9A-Za-z\-]+\.)*[0-9A-Za-z\-]+)?$")
}
semver_parts(version, byRef out_major, byRef out_minor, byRef out_patch, byRef out_prerelease, byRef out_build)
{
return !!RegExMatch(version, "^(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<prerelease>([0-9A-Za-z\-]+\.)*([0-9A-Za-z\-]+)))?(\+?(?P<build>([0-9A-Za-z\-]+\.)*([0-9A-Za-z\-]+)))?$", out_)
}
semver_compare(version1, version2)
{
@maul-esel
maul-esel / semver.php
Last active October 6, 2015 09:48
semver PHP lib
<?php
function semver_validate($version)
{
return !!preg_match('/^(\d+)\.(\d+)\.(\d+)(\-([0-9A-Za-z\-]+\.)*[0-9A-Za-z\-]+)?(\+([0-9A-Za-z\-]+\.)*[0-9A-Za-z\-]+)?$/', $version);
}
function semver_parts($version, &$parts)
{
return !!preg_match('/^(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<prerelease>([0-9A-Za-z\-]+\.)*[0-9A-Za-z\-]+))?(\+(?P<build>([0-9A-Za-z\-]+\.)*[0-9A-Za-z\-]+))?$/', $version, $parts);
}
function semver_compare($version1, $version2)
/*
Title: LVX Library
Row colouring and cell editing functions for ListView controls.
Remarks:
Cell editing code adapted from Michas <http://www.autohotkey.com/forum/viewtopic.php?t=19929>;
row colouring by evl <http://www.autohotkey.com/forum/viewtopic.php?t=9266>.
Many thanks to them for providing the code base of these functions!