Skip to content

Instantly share code, notes, and snippets.

Avatar

Ehsan Kia EhsanKia

View GitHub Profile
View gist:259f3f97a0e371f59617
### 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:
View turn2kill.py
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 Apr 25, 2014
Fetches transcript from minerva
View minverva_transcript
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 Aug 29, 2015
peerjs.d.ts
View peer.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;