Skip to content

Instantly share code, notes, and snippets.

View Jaliborc's full-sized avatar

João Cardoso Jaliborc

View GitHub Profile
@Jaliborc
Jaliborc / Quick Exponentiation
Created April 30, 2012 15:09
Exponentiation by squaring
def square(x): return x * x
def mod_exp(a , b, q):
print(b)
if b == 0: return 1
if b % 2 == 0: return square(mod_exp(a , b / 2, q))
return a * mod_exp(a , b - 1, q)
@Jaliborc
Jaliborc / Upload to Curse.py
Created January 6, 2012 18:59
This is a simple script that will upload your zipfile to CurseForge. Also works on WoWAce.
import requests
headers = {
'User-Agent': 'CurseForge Uploader Script/1.0',
'X-API-Key': YOUR_KEY
}
files = {'file': ('MyFile.zip', open('MyFile.zip', 'r'))}
data = {
'name': 'Version Banana',