Skip to content

Instantly share code, notes, and snippets.

@afiram
afiram / ExportKindle.js
Last active January 9, 2022 08:20 — forked from jkubecki/ExportKindle.js
Amazon Kindle Export
// The following data should be run in the console while viewing the page https://read.amazon.com/
// It will export a CSV file called "download" which can (and should) be renamed with a .csv extension
// var db = openDatabase('K4W', '3', 'thedatabase', 1024 * 1024);
var db = openDatabase('K4W', '5', 'thedatabase', 1024 * 1024);
getAmazonCsv = function() {
// Set header for CSV export line - change this if you change the fields used
var csvData = "ASIN,Title,Authors,PurchaseDate\n";
@afiram
afiram / settings_test_snippet.py
Created July 11, 2016 01:42 — forked from NotSqrt/settings_test_snippet.py
Another shot at this problem ..
class DisableMigrations(object):
def __contains__(self, item):
return True
def __getitem__(self, item):
return "notmigrations"
MIGRATION_MODULES = DisableMigrations()
@afiram
afiram / settings_test_snippet.py
Created February 8, 2016 06:33 — forked from nealtodd/settings_test_snippet.py
Skip migrations for a Django 1.7 test run
# If your test settings file doesn't import any other settings file
# then you can use the function directly:
def prevent_tests_migrate(db):
import django
from django.db import connections
from django.db.migrations.executor import MigrationExecutor
django.setup()
ma = MigrationExecutor(connections[db]).loader.migrated_apps
return dict(zip(ma, ['{a}.notmigrations'.format(a=a) for a in ma]))