🧙♂️
This file contains hidden or 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 hidden or 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('pythonista@deentaylor.com', '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 hidden or 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 hidden or 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 hidden or 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 os | |
| import urllib2 | |
| from collections import Counter | |
| #FETCH DATA | |
| files=os.listdir(os.path.expanduser("~/Library/Caches/Metadata/Safari/History")) | |
| webpages=[f for f in files if f.startswith("http")] #https also starts with http | |
| print "Found {} pieces of data".format(len(webpages)) |
This file contains hidden or 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
| #Scrapes wikipedia. Start with the name of a page. Then, it will click the first | |
| #5 links on this page. For each of these links, it will click the first 5 links | |
| #on *that* page. It will not stray more than 5 pages away from the start page. | |
| #These attributes can be adjusted by changing BREADTH and MAXDEPTH. This script | |
| #will output a PNG file of your wikipedia map. | |
| #REQUIREMENTS: `wikipedia` and `pydot` | |
| import wikipedia as wp | |
| import pydot |
This file contains hidden or 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
| classes=['NSAKDeserializer', 'NSAKDeserializerStream', 'NSAKSerializer', 'NSAKSerializerStream', 'NSAbstractLayoutGuide', 'NSAddressCheckingResult', 'NSAffineTransform', 'NSArchiver', 'NSArrayChange', 'NSArrayChanges', 'NSAssertionHandler', 'NSAttributedString', 'NSAutoreleasePool', 'NSAutoresizingMaskLayoutConstraint', 'NSBigMutableString', 'NSBlockExpression', 'NSBlockOperation', 'NSBlockPredicate', 'NSBoundKeyPath', 'NSBundle', 'NSBundleResourceRequest', 'NSByteCountFormatter', 'NSCachedURLResponse', 'NSCalendarDate', 'NSCharacterSet', 'NSCheapMutableString', 'NSCoder', 'NSComparisonPredicate', 'NSComparisonPredicateOperator', 'NSComplexOrthography', 'NSComplexRegularExpressionCheckingResult', 'NSCompoundPredicate', 'NSCompoundPredicateOperator', 'NSConcreteAttributedString', 'NSConcreteMutableAttributedString', 'NSConcreteValue', 'NSCondition', 'NSConditionLock', 'NSConstantString', 'NSConstantValueExpression', 'NSContentSizeLayoutConstraint', 'NSCorrectionCheckingResult', 'NSCountedSet', 'NSDashCheckingR |
This file contains hidden or 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
| """A set of operations for working with the file lists returned from zipfile.ZipFile.namelist()""" | |
| import os | |
| def getParentDirs(path): | |
| """ "test/again/hello" -> ["test", "test/again"] """ | |
| dirs = path.split("/")[:-1] | |
| if dirs: | |
| return ["/".join(dirs[:i+1]) for i,d in enumerate(dirs) if dirs[:i+1]] | |
| else: |
This file contains hidden or 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
| # Tool to sort organization repos by star count, as a workaround for https://github.com/isaacs/github/issues/201. | |
| # It would be *awesome* if GitHub could implement this... | |
| import requests, json | |
| USERNAME = "YOUR_USERNAME_HERE" | |
| PASSWORD = "YOUR_PASSWORD_HERE" | |
| def parse_links(linkstr): | |
| # At the end of paging, 'last' is no longer returned as second link |
This file contains hidden or 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
| module.exports = { | |
| config: { | |
| // default font size in pixels for all tabs | |
| fontSize: 12, | |
| // font family with optional fallbacks | |
| fontFamily: '"Fira Code", Menlo, "DejaVu Sans Mono", "Lucida Console", monospace', | |
| // terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk) | |
| cursorColor: '#cdd2e9', |