Skip to content

Instantly share code, notes, and snippets.

View EhsanKia's full-sized avatar

Ehsan Kia EhsanKia

View GitHub Profile
### Keybase proof
I hereby claim:
* I am ehsankia on github.
* I am ehsankia (https://keybase.io/ehsankia) on keybase.
* I have a public key whose fingerprint is 00CB 342D 7DE5 B7A7 052E 6FDF 6174 9B8C 5D4F A042
To claim this, I am signing this object:
from random import shuffle
def trial():
# Deck comprised of 30 cards, two of each. Assume:
# 0=Lightwarden, 1=CoH, 2=Pyromancer, 3=Silence
deck = range(15) + range(15)
shuffle(deck)
# Initial 4 draws
hand = [deck.pop() for i in range(4)]
@EhsanKia
EhsanKia / minverva_transcript
Created April 25, 2014 17:06
Fetches transcript from minerva
import requests
LOGIN_URL = "https://horizon.mcgill.ca/pban1/twbkwbis.P_ValLogin"
DATA_URL = "https://horizon.mcgill.ca/pban1/bzsktran.P_Display_Form"
def login(username, password):
info = {"sid": username, "PIN": password}
cookies = {"TESTID": "set"}
r = requests.post(LOGIN_URL, data=info, cookies=cookies)
return r.cookies.get("SESSID")
@EhsanKia
EhsanKia / peer.d.ts
Last active August 29, 2015 13:58
peerjs.d.ts
interface DataConnection {
send(data: any): void;
close(): void;
on(event: string, callback: (p?: any) => void): void;
bufferSize: number;
dataChannel: Object;
label: string;
metadata: any;
open: boolean;
peerConnection: Object;