Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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 / 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 / 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 / Fish.ahk
Last active August 29, 2015 14:06
/r/DailyProgrammer
Title := "}{FISH}"
Stats := {"Hunger": 50, "Drowsy": 80, "Health": 75, "Bowels": 10, "Thirst": 0}
Sleeping := False
Gui, Add, Text, r6 w75 -VScroll +ReadOnly vScreen
GoSub, UpdateStats
Gui, Add, Button, vButton1 gFeed ys x+5 w100, Feed
Gui, Add, Button, vButton2 gSleep w100, Put to bed
Gui, Add, Button, vButton3 gKill w100, Put to sleep
Gui, Add, Text, xm w175 Center vTicker, Your fish
@G33kDude
G33kDude / BubbleSort.ahk
Last active August 29, 2015 14:06
/r/DailyProgrammer
Size := 100
PixSize := 5
GuiSize := Size * PixSize
Stack := []
Loop, % Size
Stack.Insert(Rand(0.0, 1.0))
Gui, +hWndhWnd -Caption
@G33kDude
G33kDude / QuickSort.ahk
Last active August 29, 2015 14:06
Quicksort fo /r/DailyProgrammer
Size := 600
PixSize := 1
GuiSize := Size * PixSize
List := []
Loop, % Size
List.Insert(Rand(0.0, 1.0))
Gui, +hWndhWnd -Caption
Ascii =
(
; Necessary newline
+----+
| |
+-------------------------+-----+----+
| | | |
| +-------------------+-----+ |
| | | | |
| | | | |