Skip to content

Instantly share code, notes, and snippets.

@markallanson
markallanson / html2ghostjson.py
Last active January 16, 2025 14:34
I needed to convert a simple html page with some image links to a ghost import json/zip. Simply zip the output of this script and import into ghost.
import shutil
from bs4 import BeautifulSoup
import json
from pathlib import Path
import argparse
class HtmlToGhostConverter:
def __init__(self, html_path, image_dir=None):
"""
@markallanson
markallanson / html2ghostjson.py
Last active November 11, 2024 17:12
This is a script generated using Claude.ai that converts a static HTML file (including images) to a Ghost-friendly json file. Once you have this json file you can use the ghost html-to-json conversion tool to convert it to mobiledoc ready for import into Ghost.
import os
import base64
import mimetypes
from bs4 import BeautifulSoup
import requests
import json
from pathlib import Path
import argparse
class HtmlToGhostConverter:
@markallanson
markallanson / YoutubeDissapearingVideosReasons.txt
Created June 1, 2024 19:22
Moving my youtube account viewing history to another account has been a fun experience. Out of 19094 videos in my watch history, 1126 are no longer available. There were 88 unique reasons. This is the de-duplicated list of all reasons.
Invalid start time (264.0 > 229) for chapter "rinse it thoroughly with soap"
Falling back on generic information extractor
Falling back on generic information extractor
Incomplete data received in embedded initial data; re-fetching using API.
Not Found
Service Unavailable
This live stream recording is not available.
This video has been removed for violating YouTube's Community Guidelines
This video has been removed for violating YouTube's policy on repetitive or misleading metadata
This video has been removed for violating YouTube's policy on violent or graphic content
@markallanson
markallanson / hll_error_rate.md
Last active October 5, 2020 11:39
HLL Error Rate Quick Reference

HLL Error Rate Quick Reference

To save having to calculate this every time I think about HLL, here is a quick reference for log2m to error rate conversion. The error rate is presented to a max of 2 decimal places

Log2m Error Rate ± %
9 4.60
10 3.25
11 2.30

Keybase proof

I hereby claim:

  • I am markallanson on github.
  • I am markallanson (https://keybase.io/markallanson) on keybase.
  • I have a public key ASCrv4KAQNkCGQfDn2KRHDddYTjK9qOT3voV3Stcb0T30Ao

To claim this, I am signing this object:

@markallanson
markallanson / vuteTemplateUrl.js
Last active October 8, 2016 19:05
Beating Vue.js at it's own game - using require.js for psuedo templateUrl support for those of us who can't bear to mix markup and code.
define([
"Vue",
"text!./devices.html"
], function(Vue, devicesTemplate) {
"use strict";
return Vue.component("piarmed-devices", {
template: devicesTemplate
});
});