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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script> | |
| function loadXMLDoc() { | |
| var xmlhttp; | |
| if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari | |
| xmlhttp = new XMLHttpRequest(); | |
| } else { // code for IE6, IE5 |
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
| struct Resource<T> { | |
| let url: URL | |
| // Other properties and methods | |
| } | |
| class NetworkManager { | |
| func load<T>(resource: Resource<T>, withCompletion completion: @escaping (T?) -> Void) { | |
| let session = URLSession(configuration: .ephemeral, delegate: nil, delegateQueue: .main) | |
| let task = session.dataTask(with: resource.url, completionHandler: { (data: Data?, response: URLResponse?, error: Error?) -> Void in | |
| guard let data = data 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
| // This script cancels all subscriptions in Amazon Subscribe and Save, which is fairly annoying to do manually one by one (it's def intentional) | |
| // Inspired by reddit post https://www.reddit.com/r/amazonprime/comments/1d3agri/mass_cancel_move_all_subscribe_save_items_in_bulk | |
| // Improved on getting subscriptionId, and fetching the urls (so it doesn't open a new tab on every unsub) | |
| // Ussage | |
| // 1. Visit this URL showing all subs: https://www.amazon.com/auto-deliveries/subscriptionList?listFilter=active | |
| // 2. Press the "Show more subscriptions" button until you can see every item you're subscribed to | |
| // 3. Open developer tool(cmd + opt + i) and paste the following into Javascript console. Then hit Enter | |
| // 4. Profit |