This file contains hidden or 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
| import express from "express"; | |
| const { APP_PORT } = process.env; | |
| const appPort = parseInt(APP_PORT, 10) || 3000; | |
| const app = express(); | |
| app.use(express.json()); | |
| app.use(express.urlencoded({ extended: true })); |
This file contains hidden or 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
| import { readFileSync, writeFileSync } from "fs"; | |
| import { DateTime } from "luxon"; | |
| import { stringify } from "yaml"; | |
| // Subfolder in the vault | |
| const PATH_TO_FOLDER = "/Users/joshcanhelp/Notes/Log/Day One/"; | |
| // Day One tags as keys, Obsidian tags as values | |
| const tagMap = { | |
| FromTag1: "to-tag-1", |
This file contains hidden or 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
| const axios = require("axios"); | |
| const customClaimNamespace = "https://wp/has_account"; | |
| exports.onExecutePostLogin = async (event, api) => { | |
| const { | |
| WP_API_CLIENT_ID, | |
| WP_API_IDENTIFIER, | |
| WP_API_BASE_URL, | |
| WP_API_TOKEN, |
This file contains hidden or 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
| exports.onExecutePostLogin = async (event, api) => { | |
| const CLIENTS_NEEDING_MFA = [ | |
| "CLIENT_ID_NEEDING_MFA_1", | |
| "CLIENT_ID_NEEDING_MFA_2" | |
| ]; | |
| if (!CLIENTS_NEEDING_MFA.includes(event.client.client_id)) { | |
| return; | |
| } |
This file contains hidden or 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
| const { opendir, writeFile, readFile } = require('fs/promises'); | |
| const uniqueMonth = []; | |
| (async () => { | |
| const dir = await opendir('./_in'); | |
| for await (const dirent of dir) { | |
| const namePieces = dirent.name | |
| .replace("st,", "") | |
| .replace("nd,", "") |
This file contains hidden or 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
| const { generateKeyPair } = require('jose/util/generate_key_pair'); | |
| const { fromKeyLike } = require('jose/jwk/from_key_like'); | |
| (async () => { | |
| const { privateKey } = await generateKeyPair('RS256'); | |
| const jwk = await fromKeyLike(privateKey); | |
| console.log(JSON.stringify(jwk)); | |
| })(); | |
| // $ npm install jose |
This file contains hidden or 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
| async function checkWordPressForUser(user, context, callback) { | |
| if (!user.email) { | |
| console.log("User does not have an email to use."); | |
| return callback(null, user, context); | |
| } | |
| const customClaimNamespace = "https://custom-claim/has_wp_account"; | |
| const { | |
| WP_API_CLIENT_ID, | |
| WP_API_IDENTIFIER, |
This file contains hidden or 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
| version: '3.3' | |
| services: | |
| db: | |
| image: mysql:5.7 | |
| volumes: | |
| - db_data:/var/lib/mysql | |
| restart: always | |
| environment: | |
| MYSQL_ROOT_PASSWORD: wordpress |
This file contains hidden or 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
| # ... | |
| export AUTH0_API2_TOKEN="Your management API token goes here" | |
| export AUTH0_API2_DOMAIN="Your tenant domain goes here" | |
| # https://cli.netlify.com/ | |
| alias sync_ulp='netlify deploy --prod --dir . && curl --request PUT \ | |
| --data "@./index.html" \ | |
| --header "authorization: Bearer $AUTH0_API2_TOKEN" \ | |
| --url "https://$AUTH0_API2_DOMAIN/api/v2/branding/templates/universal-login" \ |
This file contains hidden or 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
| while IFS= read -r -d '' file | |
| do | |
| if grep -qr "$file" ../content/md | |
| then echo "Keeping $file"; | |
| else rm "$file"; | |
| fi | |
| done < <(find _images -type f -print0) |
NewerOlder