Skip to content

Instantly share code, notes, and snippets.

Avatar

Émile Jetzer ejetzer

  • Polytechnique Montréal
  • Verdun, Québec
View GitHub Profile
View McGill Courses Crawler.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import html.parser
import requests, shelve, pathlib
class ListParser(html.parser.HTMLParser):
def __init__(self, to_feed, *args, **kargs):
self.in_good = False
View make_html.py
# -*- coding: utf-8 -*-
import markdown2 as md2
from string import Template
from pathlib import Path
MD_EXTRAS = ['code-friendly',
'fenced-code-blocks',
'footnotes',
'header-ids',
View Compile Tasks.py
# coding: utf-8
import appex, dialogs, console
import plistlib, copy, webbrowser, urllib, time
# check out http://handleopenurl.com/
db = 'Tasks.txt'
url = 'omnifocus://task/%s'
due = 'due://x-callback-url/add?title=%s&hourslater=4&x-success=pythonista://&x-error=pythonista://&x-source=Pythonista'
View Compile Tasks.py
# coding: utf-8
import appex, dialogs, scene
import plistlib, copy, webbrowser, urllib, time
# check out http://handleopenurl.com/
db = 'Tasks.txt'
url = 'omnifocus://task/%s'
due = 'due://x-callback-url/add?title=%s&hourslater=4&x-success=pythonista://&x-error=pythonista://&x-source=Pythonista'
View Share Task.py
# coding: utf-8
import appex, dialogs, scene
import plistlib, copy, webbrowser, urllib, time
# check out http://handleopenurl.com/
url = 'omnifocus://task/%s'
def get_tasks(shared):
View Compile Tasks.py
# coding: utf-8
import appex, dialogs, scene
import plistlib, copy, webbrowser, urllib, time
# check out http://handleopenurl.com/
db = 'Tasks.txt'
url = 'omnifocus://task/%s'
due = 'due://x-callback-url/add?title=%s&hourslater=4&x-success=pythonista://&x-error=pythonista://&x-source=Pythonista'
View Untitled.py
# coding: utf-8
import webbrowser
due = 'due://x-callback-url/add?title=%s&hourslater=4&x-success=pythonista://&x-error=pythonista://&x-source=Pythonista'
webbrowser.open(due % 'a')
print 'a'
webbrowser.open(due % 'b')
print 'b'
View Untitled.py
# coding: utf-8
import webbrowser
due = 'due://x-callback-url/add?title=%s&hourslater=4&x-success=pythonista://&x-error=pythonista://&x-source=Pythonista'
webbrowser.open(due % 'a')
print 'a'
webbrowser.open(due % 'b')
print 'b'
View NNWM Wordcount.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys, requests, hashlib
if sys.version_info.major == 2: input = raw_input
# You can get you key from http://nanowrimo.org/api/wordcount
KEY = '8996ghhhftdgn87j'
View Error detection.py
import numbers, decimal, fractions, sympy, itertools
def permutations(p):
res = set()
for i in range(len(p)):
for q in itertools.permutations(p, i):
res.add(q)
return res
def compose(funcs):