Skip to content

Instantly share code, notes, and snippets.

xPosArr := [] ; mouse `X position` array
charArr := { right : "H", left : "K" } ; `send keys` array
left := false, right := false ; initializers
speed := 100 ; speed for accuracy
CoordMode, Mouse, Screen
Loop
{
; get mouse cursor position
Stop := 0
While ( Stop = 0 ) ; 786, 33 1096, 70 ; << PARAMETER VALUES COMMENTED OUT!!
{
msgbox % "While Loop #1`nStop's value: " ( ( Stop ) ? "true" : "false" )
Stop = 1
; ^^ this evaluates the while expression true
}
msgbox % "After loop exit`nStop's value: " ( ( Stop ) ? "true" : "false" )
ComObjConnect( wSinkObj := ComObjCreate( "WbemScripting.SWbemSink" ), "EventHandler_" )
ComObjGet( "winmgmts:\\.\root\WMI" ).ExecNotificationQueryAsync( wSinkObj, "SELECT * FROM WmiMonitorBrightnessEvent" )
Return
EventHandler_OnObjectReady( eventObj )
{
tooltip display brightness changed!
}
DispBrtObj := new DispBrtClass()
Return
class DispBrtClass
{
__New()
{
ComObjConnect( this.wSinkObj := ComObjCreate( "WbemScripting.SWbemSink" ), this.EventHandler )
ComObjGet( "winmgmts:\\.\root\WMI" ).ExecNotificationQueryAsync( this.wSinkObj, "SELECT * FROM WmiMonitorBrightnessEvent")
}
@TLMcode
TLMcode / install.sh
Created May 26, 2018 18:06 — forked from ezimuel/install.sh
Verify and install composer from bash command line
#!/bin/bash
# Verify and install composer from https://getcomposer.org/installer
me=`basename "$0"`
if [[ $# -eq 0 ]] ; then
echo "Usage: $me <hash>"
echo 'where <hash> is the hash value of the installer to verify'
exit 1
fi
@TLMcode
TLMcode / install.sh
Created May 26, 2018 18:06 — forked from ezimuel/install.sh
Verify and install composer from bash command line
#!/bin/bash
# Verify and install composer from https://getcomposer.org/installer
me=`basename "$0"`
if [[ $# -eq 0 ]] ; then
echo "Usage: $me <hash>"
echo 'where <hash> is the hash value of the installer to verify'
exit 1
fi
@TLMcode
TLMcode / GoogleServices.php
Last active February 23, 2022 16:09
Google API Service Endpoints in PHP & cURL
<?php
class GoogleServices
{
public function __construct()
{
$this->SetVariables();
$this->VerifyToken();
}
@TLMcode
TLMcode / PHPObjectArrays.php
Created February 19, 2018 17:03
Pushing values into PHP Object Arrays
$ObjectArr = (Object) [ "name" => (Object) [ "subarr" => [] ] ];
array_push( $ObjectArr->name->subarr, "value", "poo", "next" );
echo $ObjectArr->name->subarr[ 0 ];
/*
$ObjectArr
stdClass (1) ( public 'name' -> stdClass (1) ( public 'subarr' -> array (3) [ 0 => string (3) "foo" 1 => string (3) "bar" 2 => string (4) "next" ] ) )
@TLMcode
TLMcode / inv_id_code.php
Last active January 14, 2018 13:50
product or service id en/decode
// ## invoice id en/decode
function inv_id_code( $id, $act )
{
$str = null;
if ( ( $act == 0 || $act == false ) && ( $id != "" ) && preg_match( "/^\w{16}$/i", $id ) == true )
{
foreach( str_split( strrev( $id ), 4 ) as $i => $seg )
{
$str .= "-" . strtoupper( strrev( $seg ) );
@TLMcode
TLMcode / Object_Array_Keys.ahk
Last active January 11, 2018 01:56
Push Values To Object Array Keys Correctly in AHk
SDDir = C:\some_directory ; some example directory
FilePropObj := { name : [], size : [], file : [ { name : "", size : "" } ] }
FileObj := [ { name : "", size : "" } ]
Loop, Files, % SDDir "\*", R
{
FileObj[ a_index , "name" ] := A_LoopFileName
FileObj[ a_index , "size" ] := A_LoopFileSize