Skip to content

Instantly share code, notes, and snippets.

View Uberi's full-sized avatar

Anthony Zhang Uberi

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / 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)
{
@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 / 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 / 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 = {}