Skip to content

Instantly share code, notes, and snippets.

@carlosabalde
carlosabalde / fire-and-forget.py
Created August 24, 2019 10:16
Simple Python fire & forget skeleton useful to launch heavy tasks as background processes
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
- Requirements:
+ python-daemon==2.2.3
'''
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
@carlosabalde
carlosabalde / bookmarklet.js
Last active November 20, 2019 15:09
Simple bookmarklet to flush the state of the New York Times metered paywall. Once the 10 articles per month limit is reached and the subscription popup raises, simply click on the bookmarklet. Your metering quota will be reset to 0 and the current page reloaded to show the full article. Check out comments in the code for further details.
javascript:(function() {
if (window.location.host.match(/nytimes.com$/)) {
/* Flush all cookies. */
var cookies, subdomain, pathname;
cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
subdomain = '.' + window.location.host;
while (subdomain) {
pathname = window.location.pathname;
while (pathname) {