Skip to content

Instantly share code, notes, and snippets.

@TLMcode
TLMcode / keylogger.js
Created August 21, 2013 17:01
rudimentary key events with ascii code conversion in jquery
$('body').keypress(function(event) {
alert("pressed "+" "+String.fromCharCode(event.which));
});
@TLMcode
TLMcode / WatchWindow.ahk
Last active December 21, 2015 10:39
WatchWindow.ahk
SetTimer, WatchWindow, 100
return
WatchWindow:
if WinExist("Untitled - Notepad") && (Clipboard~="CIS\w{4}\b")
{
ControlSetText, Edit1, % Clipboard, Untitled - Notepad
SetTimer, WatchWindow, Off
ToolTip
}
Gui Add, ActiveX, xm w600 h300 vSysMon, Sysmon.3
SysMon.ShowValueBar := "True"
SysMon.Counters.Add("\Process(*)\% Processor Time")
; SysMon.GraphTitle := "System Performance Overview"
; SysMon.Counters.Item(1).Width := 8
Gui Show
Return
GuiClose:
ExitApp
@TLMcode
TLMcode / GenRndStr().ahk
Last active December 20, 2015 21:39
GenRndStr()
F1::MsgBox % GenRndStr( 10 )
Return
GenRndStr( len )
{
loop % (122, d="~")
cStr .= chr( (i:=a_index)>32&&i<60 ? i : i>59&&i<91 ? i : i>93&&i<125 ? i : "" ) d
cStr:=regexreplace(cStr, d d)
while ( strlen(nStr)<len )
@TLMcode
TLMcode / inkocx.ahk
Created August 10, 2013 02:59
Testing ink OCX control object
; ink.Enabled := True ; enables/disables the control
; ink.RecognitionTimeout := 100 ; speed of refresh when the mouse is lifted
; ink.BackColor := 200*256*256+250*256+250 ; background color
Gui Add, Text,, Draw in the picture box below or hand write text below that.
Gui Add, ActiveX, xm w600 h300 vss, msinkaut.InkPicture.1
Gui Add, ActiveX, xm w300 h100 vink, InkEd.InkEdit.1
(ink.UseMouseForInput := True), ink.InkInsertMode := 0
Gui, Show
Return
@TLMcode
TLMcode / findevents.ahk
Last active December 20, 2015 14:48
test event
IEObj := ComObjCreate("InternetExplorer.Application"), IEObj.Visible := 1
ComObjConnect(IEObj, new Events_Class)
Return
class Events_Class
{
__Call(event, p*)
{
ToolTip, %event%
@TLMcode
TLMcode / IEGet2().ahk
Created July 31, 2013 05:03
IEGet2()
IEGet2(name="") {
for obj in ComObjCreate("Shell.Application").Windows
if !obj.AddressBar && (obj.document.title==RegExReplace(name,".*\K\h-.*"))
break
return obj
}
@TLMcode
TLMcode / Wait().ahk
Last active December 20, 2015 07:29
Wait() for IE client objects.Watch this Gist for updates.
Wait( obj, len=300 )
{
While (obj.ReadyState=4)
continue
While (StrLen(rs)<len)
rs.=((_:=obj.ReadyState)=4?_:)
}
@TLMcode
TLMcode / BasicScriptStarter.ahk
Created July 25, 2013 03:45
Basic Script Starter
CoordMode, ToolTip, Screen
reStart:
InputBox, scriptName, Name of New Script, % "Current AHK version is: AHK"
. ( InStr( A_AhkVersion, "1.0." ) ? "Basic " : InStr( A_AhkVersion, "1.1." )
? "_L " : "Unknown " ) A_AhkVersion,,, 130
If ( ErrorLevel )
ExitApp
Else If ( !scriptName ) {
MsgBox, You Didn't Enter A Name!
GoSub, reStart
@TLMcode
TLMcode / Wait().ahk
Last active December 20, 2015 02:49
IE DOM Wait()
Wait(pwb) ; example call
Wait(_obj,_int=100) {
While(!Instr(rs,4)||StrLen(rs)<_int)
rs.=_obj.ReadyState
}