Skip to content

Instantly share code, notes, and snippets.

View Uberi's full-sized avatar

Anthony Zhang Uberi

View GitHub Profile
@Uberi
Uberi / LoadOBJ.ahk
Last active September 25, 2015 16:58
OBJ File Importer (AutoHotkey)
#NoEnv
/*
Usage:
LoadOBJ(A_ScriptDir . "\Mesh.obj")
*/
LoadOBJ(ByRef Mesh,ObjectName)
{
VerticesIndex := 1, TexCoordsIndex := 1, VertexNormalsIndex := 1
@Uberi
Uberi / Forum Functions.ahk
Created September 19, 2011 23:25
Forum Search - search the AutoHotkey forums programmatically.
#NoEnv
/*
Search := ForumSearch("","","Uberi",2) ;search the "Scripts & Functions" forum for topics by Uberi
TopicList := ""
For Index, Result In Search
{
If (Result.Author = "Uberi")
TopicList .= Result.Title . "`n"
@Uberi
Uberi / Natural Compare.ahk
Last active October 6, 2015 07:08
Natural comparison function, accounting for numeric values.
#NoEnv
A := "1.010"
B := "1.02"
Value := NaturalCompare(A,B)
If Value = -1
MsgBox, %A% < %B%
Else If Value = 1
MsgBox, %A% > %B%
Else
@Uberi
Uberi / raycast3d.lua
Last active February 28, 2016 16:24
3D voxel raycasting example
raycast3D = function(pos, dir, callback)
local base = {x=math.floor(pos.x), y=math.floor(pos.y), z=math.floor(pos.z)}
local stepx, stepy, stepz = 0, 0, 0
local componentx, componenty, componentz = 0, 0, 0
local intersectx, intersecty, intersectz = 0, 0, 0
if dir.x == 0 then
intersectx = math.huge
elseif dir.x > 0 then
stepx = 1
@Uberi
Uberi / gist:3165409
Created July 23, 2012 18:54
Google Cache Downloader
Search := "site:autohotkey.net/~Uberi filetype:ahk"
OutputPath := A_ScriptDir . "\CacheFiles"
Search := "http://www.google.com/search?q=" . URLEncode(Search)
Loop
{
SearchResult := Get(Search)
FoundPos := 1
While, FoundPos := RegExMatch(SearchResult,"S)<a href=""([^""]*)""[^>]*>Cached</a>",Match,FoundPos)
@Uberi
Uberi / Decompiler.ahk
Last active April 3, 2023 13:16
AHK script decompiler with GUI. Based on IsNull's [decompiler](http://www.autohotkey.com/board/topic/82986-ahk-l-decompiler-payload-method/).
#NoEnv
SetBatchLines, -1
Gui, Font, s16, Arial
Gui, Add, Edit, x10 y10 w450 h30 vPath gUpdate
Gui, Add, Button, x460 y10 w30 h30 gSelectFile, ...
Gui, Font, s12, Courier New
Gui, Add, Edit, x10 y50 w480 h340 vCode ReadOnly -Wrap, <Output>
Gui, Show, w496 h398, AutoHotkey Decompiler
@Uberi
Uberi / Tanks Backup.py
Created November 8, 2012 18:05
Mini Shooter Game for Pythonista (iOS)
from scene import *
import sound
class MyScene (Scene):
def setup(self):
# This will be called before the first frame is drawn.
self.root_layer = Layer(self.bounds)
self.bullets = {}
@Uberi
Uberi / webclip.py
Last active December 12, 2019 10:38 — forked from pudquick/webclip.py
import uuid, BaseHTTPServer, select, types, webbrowser, editor, os, urllib
from SimpleHTTPServer import SimpleHTTPRequestHandler
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
global mobile_config_str
mobile_config_str = ''
@Uberi
Uberi / gist:5474550
Created April 27, 2013 20:24
k-element permutation count.
import math
def permutation_count(k, n):
"Computes the number of k-element permutations in a sequence of length n."
return math.factorial(n) / math.factorial(n - k)
@Uberi
Uberi / Binary.ahk
Last active December 17, 2015 00:39
Functions for converting between binary, text, and integers.
;AHK v1
#NoEnv
/*
MsgBox % BinaryToText(Temp1 := TextToBinary("Test")) . "`n" . Temp1
MsgBox % BinaryToNumber(Temp1 := NumberToBinary(1234)) . "`n" . Temp1
*/
TextToBinary(ByRef InputText)
{