Skip to content

Instantly share code, notes, and snippets.

View Uberi's full-sized avatar

Anthony Zhang Uberi

View GitHub Profile
@Uberi
Uberi / Modster.ahk
Last active December 26, 2015 10:14
MODSTER source code. Check out the [forum topic](http://forum.minetest.net/viewtopic.php?id=6497)! Licensed under the AGPLv3.
#NoEnv
Gui, Font, s36, Arial
Gui, Add, Text, x10 y10 w760 h50 Center, MODSTER 2.0
Gui, Font, s12
Gui, Add, Groupbox, x10 y80 w760 h110, Where is the Minetest folder?
Gui, Font, s22
Gui, Add, Edit, x20 y110 w690 h40 vMinetestPath gCheckMinetest
Gui, Add, Button, x710 y110 w50 h40 gSelectMinetest, ...
@Uberi
Uberi / Ping.ahk
Created July 12, 2013 19:35
SimplePing - AHK library providing a variety of ICMP pinging-related functionality.
#NoEnv
/*
SimplePing
==========
AHK library providing a variety of ICMP pinging-related functionality.
Examples
--------
@Uberi
Uberi / Speech Recognition.ahk
Created August 18, 2013 20:29
Speech recognition with Microsoft's SAPI. A simple SpeechRecognizer class provides a quick and easy way to use speech recognition in your scripts. Inspired by some [prototype code](http://www.autohotkey.com/board/topic/24490-voice-recognition-com/) made a long time ago.
#NoEnv
#Warn All
#Warn LocalSameAsGlobal, Off
#Persistent
/*
Speech Recognition
==================
A class providing access to Microsoft's SAPI. Requires the SAPI SDK.
@Uberi
Uberi / Binary Heap.ahk
Last active December 22, 2015 10:28
Implementation of a simple and extensible binary heap.
#NoEnv
/*
Basic example:
Heap := new BinaryHeap
For Index, Value In [10,17,20,30,38,30,24,34]
Heap.Add(Value)
MsgBox % Heap.Peek()
Loop, 8
@Uberi
Uberi / spin.c
Last active December 17, 2021 06:46
Spinning Thing source code for PIC16F684 microcontrollers compiling with MikroC. See ![picture](http://i.imgur.com/gT8NVeR.jpg) for a picture!
/*
Anthony Zhang
Spinning Thing source code for PIC16F684 microcontrollers compiling with MikroC.
*/
#define PIN1 PORTA.RA0
#define PIN2 PORTA.RA1
#define PIN3 PORTA.RA2
#define PIN4 PORTC.RC0
#define PIN5 PORTC.RC1
@Uberi
Uberi / Waterloo LEARN Login.user.js
Last active January 4, 2016 03:29
This is a UserScript that fixes the most irritating thing about uWaterloo LEARN - the pointless, annoying alerts that your session is about to be logged out for the 50th time.
// ==UserScript==
// @name uWaterloo Learn Login
// @namespace uberi
// @description Keep the user logged into LEARN while the tab is open
// @include https://learn.uwaterloo.ca/*
// @match https://learn.uwaterloo.ca/*
// @version 1.0
// @run-at document-start
// ==/UserScript==
@Uberi
Uberi / normalize.py
Last active August 29, 2015 14:07
FaceBook chat data processing helper script. Run `normalize.py` to normalize the raw JSON data into cleaner JSON, then run `process.py` to calculate some interesting stats.
path = "data.json"
new_path = "normalized_data.json"
from urllib.parse import urlparse, parse_qs
import json
users = {
"fbid:100001608518631": "Anthony Zhang",
"fbid:1538370516": "Keri Warr",
"fbid:814604197": "Daniel Hopper",
@Uberi
Uberi / markov-single-word.py
Created October 2, 2014 04:30
Run the previous `normalize.py` on FB chat data, then run this script on its output to get sentences generated using a Markov chain.
path = "normalized_data.json"
user = "Keri Warr"
import json, sys, re
import random
from collections import defaultdict
data = json.load(open(path, "r"))
START, END = 0, 1
@Uberi
Uberi / Keri.html
Last active August 29, 2015 14:07
Keri.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>WARR NEVER CHANGES</title>
<style>
body {
background: black;
overflow: hidden;
}
@Uberi
Uberi / image_plot.py
Created November 13, 2014 02:32
Scatter plot the RGB values of an image in 3D! Requires Pillow and matplotlib, running on Python 3.
image_path = "HOPE.png"
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import pyplot
from PIL import Image
fig = pyplot.figure()
axis = fig.add_subplot(1, 1, 1, projection="3d") # 3D plot with scalar values in each axis
im = Image.open(image_path)