This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import subprocess | |
import shutil | |
from datetime import datetime, timedelta | |
from pathlib import Path | |
# Configuration | |
BASE_DIR = Path("/backup/db") | |
HOURLY_DIR = BASE_DIR / "hourly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Replace "standalone" with "fullscreen" depending on your manifest.json display mode */ | |
@media (display-mode: standalone) { | |
/* All installed PWAs */ | |
} | |
@media (max-width: 576px) and (display-mode: standalone) { | |
/* Installed PWAs on mobile devices */ | |
@supports (-webkit-overflow-scrolling: touch) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = async ({ action }, { database: knex }) => { | |
const collection_key = "page"; // collection key | |
const id_field_key = "id"; // primary key of the collection | |
const count_field_key = "read_count"; // must be an integer field | |
action(`${collection_key}.items.read`, async ({ payload }) => { | |
const IDs = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ROUND(x, p) { | |
const a = Math.floor(x * 10 ** p) * 10; | |
const c = Math.floor(x * 10 ** (p + 1)) - a; | |
return (c >= 5 ? a + 10 : a) / 10 ** (p + 1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying my Blockstack ID is secured with the address 1K3eU3WSrX1Sh7dBYA7YqeQ37SGza9ezov https://explorer.blockstack.org/address/1K3eU3WSrX1Sh7dBYA7YqeQ37SGza9ezov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is for demonstration purposes. Ideally, you should never use the star selector. | |
I recommend that you use this early on in your development, and then once you've established | |
your HTML element palette, go back and replace * with a comma-separated list of your | |
tag names. Additionally, the !important shouldn't have to be used, but I'm leaving it here | |
because some enterprising goons will probably copy and paste this directly into their project - | |
the !important will ensure these settings override other attempts that were either never | |
deleted or are part of an installed CSS file the user is unaware of. | |
*/ | |
* { |