Skip to content

Instantly share code, notes, and snippets.

@G33kDude
G33kDude / Rogue2.ahk
Last active January 24, 2022 03:55
Version 2 of the previous Rogue script. For the second step of the rogue challenge for /r/DailyProgrammer
Width := 20, Height := 20
KeyMap := {"up": "up", "left": "left", "down": "down", "right": "right"}
Map := [], BlankSquares := []
Loop, % Width
{
x := A_Index
Loop, % Height
{
y := A_Index
@G33kDude
G33kDude / Rogue.ahk
Last active August 29, 2015 14:06
A roguelike for /r/dailyprogrammer
Width := 20, Height := 20
KeyMap := {"up": "up", "left": "left", "down": "down", "right": "right"}
Map := [], BlankSquares := []
Loop, % Width
{
x := A_Index
Loop, % Height
{
y := A_Index
@G33kDude
G33kDude / PngToBase64.ahk
Last active June 18, 2018 21:06
PngToBase64
FileSelectFile, File,,, Pick a PNG, Images (*.png)
Clipboard := PngToBase64(File)
MsgBox, % "The image is now on your clipboard. Paste into your browser URL bar."
return
PngToBase64(file)
{
FileGetSize, size, % file
FileRead, bin, % "*c " file
return "data:image/png;base64," Base64enc(bin, size)
@G33kDude
G33kDude / FixIE.ahk
Last active October 1, 2022 03:09
Force embedded IE (shell.explorer) to use a better render engine
FixIE(Version=0, ExeName="")
{
static Key := "Software\Microsoft\Internet Explorer"
. "\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION"
, Versions := {7:7000, 8:8888, 9:9999, 10:10001, 11:11001}
if Versions.HasKey(Version)
Version := Versions[Version]
if !ExeName
@G33kDude
G33kDude / HtmlBox.ahk
Last active January 7, 2020 22:32
A message box style dialogue that is powered by html.
HtmlBox(HTML, Title="HtmlBox", Body=True, Full=False, URL=False, width=300, height=200)
{ ; Creates a MsgBox style GUI that has embedded HTML
global MsgBoxOK, MsgBoxActiveX, MsgBoxFull=Full
; Set up the GUI
Gui, +HwndDefault
Gui, MsgBox:New, +HwndMsgBox +Resize +MinSize +LabelMsgBox
if Full
Gui, Margin, 0, 0
else
@G33kDude
G33kDude / Gist.ahk
Last active July 29, 2017 03:21
Gist.ahk
Gist(Code, NewUser="", NewPass="", Title="AutoHotkey", Public="1")
{
static Basic, User, Pass
if (User != NewUser || Pass != NewPass) ; If new credentials
{
User := NewUser
Pass := NewPass
if (User && Pass) ; If not blank
Basic := Base64(User ":" Pass) ; Create new basic auth code