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 collections import deque | |
| def dedupe_with_history(items, key=None, history=None): | |
| previous = deque(maxlen=history) | |
| seen = set() | |
| for item in items: | |
| val = item if key is None else key(item) | |
| if val not in seen: | |
| yield item |
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 json | |
| from flask import request, url_for | |
| from flask.ext.api import FlaskAPI, status, exceptions | |
| from werkzeug.contrib.cache import SimpleCache | |
| app = FlaskAPI(__name__) | |
| cache = SimpleCache() | |
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 json | |
| with open('/home/user/Downloads/Takeout/Hangouts/Hangouts.json', 'r') as f: | |
| s = json.load(f) | |
| links = [] | |
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
| #! /usr/bin/python | |
| import requests | |
| import json | |
| import click | |
| import os | |
| import datetime | |
| requests.packages.urllib3.disable_warnings() | |
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 datetime | |
| def timed_cached(timeout=60 * 60, now=datetime.datetime.now): | |
| def outer(method_or_attribute): | |
| if not hasattr(timed_cached, '__mapping'): | |
| timed_cached.__mapping = {} |
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 8 columns, instead of 4 in line 6.
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
| id,album,artist,url,img,available,channel,added | |
| 3274251919,Horehound Debut Self-titled,Horehound,https://horehound.bandcamp.com/album/horehound-debut-self-titled,https://f4.bcbits.com/img/a1161795522_16.jpg,True,,2016-08-28T12:03:19.656392 | |
| 1430603235,Origins,Mount Soma,https://mountsoma.bandcamp.com/album/origins,https://f4.bcbits.com/img/a4202223841_16.jpg,True,,2016-08-28T12:03:19.656392 | |
| 4218933258,/ABRACADABRA\,abracadabra,https://abracadabrabracadabrabracadabra.bandcamp.com/album/abracadabra,https://f4.bcbits.com/img/a0903751040_16.jpg,True,,2016-08-28T12:03:19.656392 | |
| 2160951328,Revenge of Swampy's Creature EP,Los Savages,https://lossavages.bandcamp.com/album/revenge-of-swampys-creature-ep,https://f4.bcbits.com/img/a3177664259_16.jpg,True,,2016-08-28T12:03:19.656392 | |
| 1847541816,Mrtav,Hesperian Death Horse,https://hesperiandeathhorse.bandcamp.com/album/mrtav,https://f4.bcbits.com/img/a3395229351_16.jpg,True,doom,2016-08-29T13:21:51.946040 | |
| 1950657943,Jason...The Dragon,Weedeater,https://weedeater.bandcamp.co |
OlderNewer