Skip to content

Instantly share code, notes, and snippets.

@Craignewkirk
Craignewkirk / download_kindle.js
Created February 16, 2025 19:35 — forked from akagr/download_kindle.js
Download kindle books from Amazon web
/*
I was looking to try a non-kindle e-reader, but my library kept weighing me down. While I had calibre and the de-drm plugin, I found the downloaded books on my kindle were in kfx format and weren't playing well with calibre, even with the kfx input plugin.
Further, I found downloading books directly from web (Amazon > content library) did give me an azw3 file, which works well with de-drm.
To automate part of the process, I wrote a short js script. It doesn't walk through all the pages in content library, but it does download all the books currently visible on the list. Amazon lets us view 25 books per page, so I just had to switch pages, run script, repeat.
The meat of this script is constructing the url used to start a download. Device type, serial number, customer id etc. will be different for everyone, so it's best to download one book manually and check the network inspector for the request details. Apart from the book's `key`, all other details remain same for all the books (at least they did for me
@Craignewkirk
Craignewkirk / 0fixup.md
Created August 18, 2020 21:44 — forked from silent1mezzo/0fixup.md
On undoing, fixing, or removing commits in git

A git choose-your-own-adventure!

This document is an attempt to be a fairly comprehensive guide to recovering from what you did not mean to do when using git. It isn't that git is so complicated that you need a large document to take care or your particular problem, it is more that the set of things that you might have done is so large that different techniques are needed depending on exactly what you have done and what you want to have happen.

@Craignewkirk
Craignewkirk / apache-404-error-passing-url.rst
Created May 17, 2019 13:13 — forked from BMeu/apache-404-error-passing-url.rst
Apache: passing the requested URL to a 404 error document

Apache: Passing the Requested URL to a 404 Error Document

Sometimes you may want to pass the URL that triggered a 404 Not Found error on your Apache server to a script handling the error. Of course, you could simply set the ErrorDocument 404 /path/to/error/script directive and access the environment variables set by the directive to retrieve the requested URL. But what if this is not an option and you want the requested URL as a parameter when calling the script (see below for an example where this might be useful)? Unfortunately, the ErrorDocument does not allow rewriting the URL...

We could simulate the ErrorDocument 404 behavior using the rewrite module. Since we do not want to hardcode any URLs into

@Craignewkirk
Craignewkirk / ultimate-ut-cheat-sheet.md
Created September 27, 2018 15:37 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@Craignewkirk
Craignewkirk / monorepo-tool-comparison.md
Created June 29, 2018 16:39 — forked from morewry/monorepo-tool-comparison.md
Comparison of Monorepo Tools For Web Client / Front End Projects (That Probably Use HTML, CSS, and JS)

Mono Repository Tool Comparison

For Web Client /Front End Projects

(That Probably Use HTML, CSS, and JS)

I made a list of 20 things I might want out of a monorepo tool for a Design System to use as a basis for comparing some of the options including Lerna, Northbrook, and Rush.

⚠️ Northbrook's author says the project is pretty dead and now uses Lerna.

Qualifications Wanted

@Craignewkirk
Craignewkirk / 0main.md
Created June 27, 2018 13:55 — forked from pandeiro/0main.md
Git Best Practices

Git Best Practices

This is a fairly common question, and there isn't a One True Answer, but still, this represents a consensus from #git

Read about git

Knowing where to look is half the battle. I strongly urge everyone to read (and support) the Pro Git book. The other resources are highly

@Craignewkirk
Craignewkirk / README-Template.md
Created June 21, 2018 16:01 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@Craignewkirk
Craignewkirk / newknote-useful-unix-commands
Created June 1, 2018 16:39
NewkNote: Useful Unix Commands
find . -name "*.bak" -type f # Recursively Find all instances of a file with a specific extension
find . -name "*.bak" -type f -delete # Recursively Delete all instances of a file with a specific extension
@Craignewkirk
Craignewkirk / README.md
Created May 31, 2018 18:03 — forked from roachhd/README.md
EMOJI cheatsheet 😛😳😗😓🙉😸🙈🙊😽💀💢💥✨💏👫👄👃👀👛👛🗼🔮🔮🎄🎅👻

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. ✈ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: 😄

@Craignewkirk
Craignewkirk / README.md
Created May 2, 2018 20:01 — forked from thom4parisot/README.md
npm config + ENV variables