itenium-be / Mi-Ke

Collection of Autohotkey scripts to make daily life in Windows less dull
https://itenium.be/Mi-Ke/
MIT License
19 stars 4 forks source link

Developer tooling: handle images, encoding, hashing, linting, formatting, ... #11

Open Laoujin opened 6 years ago

Laoujin commented 6 years ago
Laoujin commented 6 years ago

figure out file encoding + change file encoding

Laoujin commented 6 years ago

Dev tools:

Laoujin commented 6 years ago
GetLocation(findip)
{
IPsearch := "http://ip-address-lookup-v4.com/lookup.php?host=ip-address-lookup-v4.com&ip=" . findip . "&x=31&y=29"
whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
whr.Open("GET", IPsearch)
whr.Send()
  sleep 100
version := whr.ResponseText
RegExMatch(version, "Near: <span class=""blueish"">(.*)</span>", Location) 
Return Location1
}

tracert, my ip adresses, dns lookup, ping, ...

Run, cmd /K "ping www.google.com"

Laoujin commented 6 years ago

https://github.com/RaptorX/AHK-ToolKit/blob/master/lib/hash.ahk

Hash(ByRef sData, SID=4) { ; SID = 3: MD5, 4: SHA1
    ; Lazlo: http://www.autohotkey.com/forum/viewtopic.php?p=113252#113252

    DllCall("advapi32\CryptAcquireContextW", UIntP,hProv, UInt,0, UInt,0, UInt,1, UInt,0xF0000000)
    DllCall("advapi32\CryptCreateHash", UInt,hProv, UInt,0x8000|0|SID, UInt,0, UInt,0, UIntP, hHash)
    DllCall("advapi32\CryptHashData", UInt,hHash, UInt,&sData, UInt,nLen := strlen(sData), UInt,0)
    DllCall("advapi32\CryptGetHashParam", UInt,hHash, UInt,2, UInt,0, UIntP,nSize, UInt,0)
    VarSetCapacity(HashVal, nSize, 0)
    DllCall("advapi32\CryptGetHashParam", UInt,hHash, UInt,2, UInt,&HashVal, UIntP,nSize, UInt,0)
    DllCall("advapi32\CryptDestroyHash", UInt,hHash)
    DllCall("advapi32\CryptReleaseContext", UInt,hProv, UInt,0)

    IFormat := A_FormatInteger
    SetFormat Integer, H
    Loop %nSize%
      sHash .= SubStr(*(&HashVal+A_Index-1)+0x100,-1)
    SetFormat Integer, %IFormat%
    Return sHash
}
Laoujin commented 6 years ago

https://github.com/ahkscript/libcrypt.ahk/tree/master/src

Laoujin commented 6 years ago

JSON

JSON to/from JS Object

If array is small and of primitives, put on one line instead Same with small objects Check array with small/large objects { "name": "true", "yaye": [0, 1, 2, 3] }

Laoujin commented 5 years ago

Zip / Unblock Select zip in window explorer Unzip with file dialog Unblock the files