🧙♂️
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from objc_util import * | |
import time | |
import notification | |
APP=UIApplication.sharedApplication() | |
DISPLAYMODE=0 | |
def setBadge(text): | |
APP.setApplicationBadgeString_(text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Spirograph.py | |
from math import * | |
import canvas | |
canvas.set_size(1024, 768) | |
import time | |
COLOR = "#000000" | |
def rotate(point, angle, center=(0, 0)): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ftplib, os, shutil, tempfile, time | |
ftp=ftplib.FTP('ftp.deentaylor.com') | |
print ftp.login('[email protected]', 'FTPythonista') | |
doc_path = os.path.expanduser('~/Documents/') | |
filename=time.strftime("%Y-%m-%d&%H:%M:%S") | |
backup_path = filename+'.zip' | |
if os.path.exists(backup_path): | |
os.remove(backup_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import json | |
import time | |
from io import BytesIO | |
from PIL import Image | |
URL="https://api.nasa.gov/planetary/earth/imagery?lon={}&lat={}&date={}&api_key={}" | |
API_KEY="ymjXp9qz2jJDR5tNEb0qa5YekynvAcVLJvKVcxYH" | |
def get_satellite_image(location=None,date=None): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xml.etree.ElementTree as ET | |
def getDialogueList(*plays): | |
dialogues = [] | |
for p in plays: | |
root = ET.parse("shakespeare/"+p+".xml") | |
playtitle = root.findtext("TITLE") | |
playsubt = root.findtext("PLAYSUBT") | |
print playtitle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2, appex, time, zipfile, os | |
a=time.time() | |
if appex.is_running_extension(): | |
url = appex.get_url() | |
print url | |
e=0 | |
else: | |
import clipboard, editor | |
url = clipboard.get() | |
e=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyimgur,photos,clipboard,os,console | |
i=photos.pick_image() | |
format = 'gif' if (i.format == 'GIF') else 'jpg' | |
i.save('img.'+format) | |
clipboard.set('.upload_image('img.'+format, title="Uploaded-Image").link)+')') | |
console.hud_alert("link copied!") | |
os.remove('img.'+format) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bs4, urllib2, webbrowser | |
starturl = raw_input('url: ') | |
#handle redirects, in case of shortened url | |
url = urllib2.urlopen(urllib2.Request(starturl)).geturl() | |
#keepvid page url | |
url = 'http://www.keepvid.com/?url='+url.split('&feature')[0] | |
#beautifulsoup object of keepvid page | |
soup = bs4.BeautifulSoup(urllib2.urlopen(url).read()) | |
#find valid links | |
links = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import appex, bs4, dialogs, urllib2, webbrowser | |
if appex.is_running_extension(): | |
starturl = appex.get_url() | |
else: | |
#ask for video url | |
starturl = dialogs.form_dialog(fields=[{'type':'url', 'title':'URL:', 'key':'url'}])['url'] | |
#handle redirects, in case of shortened url | |
url = urllib2.urlopen(urllib2.Request(starturl)).geturl() | |
#keepvid page url | |
url = 'http://www.keepvid.com/?url='+url.split('&feature')[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import math | |
from operator import itemgetter | |
import console | |
from PIL import Image, ImageDraw | |
import scene | |
class Point3D: |