Skip to content

Instantly share code, notes, and snippets.

View 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 Jan 7, 2020
A message box style dialogue that is powered by html.
View HtmlBox.ahk
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 Feb 13, 2016
Force embedded IE (shell.explorer) to use a better render engine
View FixIE.ahk
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
View PngToBase64.ahk
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 Aug 29, 2015
A roguelike for /r/dailyprogrammer
View Rogue.ahk
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 Aug 29, 2015
Version 2 of the previous Rogue script. For the second step of the rogue challenge for /r/DailyProgrammer
View Rogue2.ahk
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 Aug 29, 2015
/r/DailyProgrammer
View Fish.ahk
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 Aug 29, 2015
/r/DailyProgrammer
View BubbleSort.ahk
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 Aug 29, 2015
Quicksort fo /r/DailyProgrammer
View QuickSort.ahk
Size := 600
PixSize := 1
GuiSize := Size * PixSize
List := []
Loop, % Size
List.Insert(Rand(0.0, 1.0))
Gui, +hWndhWnd -Caption
View Squares.ahk
Ascii =
(
; Necessary newline
+----+
| |
+-------------------------+-----+----+
| | | |
| +-------------------+-----+ |
| | | | |
| | | | |