| #!/usr/bin/env python3 | |
| # Download your data dump and place this file in the "messages" folder of your data dump. | |
| # Run it using python | |
| from datetime import datetime, timedelta, timezone | |
| import dateutil.parser | |
| import matplotlib.pyplot as plt | |
| import matplotlib.ticker as ticker | |
| import matplotlib.dates as mdates | |
| import csv |
| # Updated from SvelteKit docs. See https://kit.svelte.dev/docs/adapter-static#github-pages for more information | |
| name: Deploy to GitHub Pages | |
| on: | |
| push: | |
| branches: 'main' | |
| jobs: | |
| build_site: |
Because I use Cloudflare to manage my domains and Backblaze for backups, it only made sense to take advantage of their Bandwidth Alliance for creating my own CDN. This has been incredibly helpful for image hosting for this knowledge base, however, I recently noticed that caching wasn't working as it should.
The overall problem started when I was adding a parking page for a domain I recently purchased. The background image was hosted on B2 and the image was supposed to be cached by Cloudflare. However, each time the page loaded, it would pull the image from the origin instead of the cache. I checked this on my knowledge base and found it was doing the same thing.
- Created doc while stumbling upon this PR / issue in https://github.com/night/betterttv
- Also kudos Chrome network panel
| // Based on: https://stackoverflow.com/a/46814952/283851 | |
| /** | |
| * Create a Base64 Image URL, with rotation applied to compensate for EXIF orientation, if needed. | |
| * | |
| * Optionally resize to a smaller maximum width - to improve performance for larger image thumbnails. | |
| */ | |
| export async function getImageUrl(file: File, maxWidth: number|undefined) { | |
| return readOrientation(file).then(orientation => applyRotation(file, orientation || 1, maxWidth || 999999)); | |
| } |
| var fs = require('fs'); | |
| var crypto = require('crypto'); | |
| fs.readFile('file.pdf', function(err, data) { | |
| var checksum = generateChecksum(data); | |
| console.log(checksum); | |
| }); | |
| function generateChecksum(str, algorithm, encoding) { | |
| return crypto |
While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.
Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.
lib/is intended for code that can run as-issrc/is intended for code that needs to be manipulated before it can be used
| <?php | |
| /* | |
| * to-markdown - an HTML to Markdown converter for PHP | |
| * | |
| * Copyright 2013, Blake Turner | |
| * Licenced under the MIT licence | |
| * | |
| */ |
