Skip to content

Instantly share code, notes, and snippets.

View xmiao2's full-sized avatar

James Miao xmiao2

View GitHub Profile
@xmiao2
xmiao2 / piazza_top_contrib.js
Created March 10, 2016 04:04
Get the top contributor on piazza class
var delay = 500;
var regex = /\?cid=(\d+)/;
var results = {};
$(".instructor_endorsed_sr").each(function(i, o) {
var iid = setTimeout(function(){
o.click();
// On threads with multiple answers, only first person gets credit?
var name = $("#s_answer .post_region_actions .user_name").first().text() || "Anonymous";
@xmiao2
xmiao2 / popup.cs
Created December 9, 2014 06:34
Unity3D Multi-Instance-Friendly Popup List
// A Popup List class that supports multiple instances in Unity
// Popup list created by Eric Haines.
// Popup list Extended by Xiaohang Miao. ([email protected])
public class Popup{
private int selectedItemIndex = 0;
private bool isVisible = false;
private bool isClicked = false;
private static DropdownBox current;
public int List(Rect box, GUIContent[] items, GUIStyle boxStyle, GUIStyle listStyle) {