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
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <meta name="description" content="A first-principles Reddit launch report for ContextVeil v1.0.0."> | |
| <link rel="icon" href="data:,"> | |
| <title>ContextVeil / Reddit field notes</title> | |
| <style> | |
| :root { |
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
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <meta name="description" content="A deep simplification analysis of the ContextVeil repository, with concrete scope, code, requirements, testing, and documentation recommendations."> | |
| <link rel="icon" href="data:,"> | |
| <title>ContextVeil: A Leaner Path to V1</title> | |
| <style> | |
| :root { |
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
| #!/usr/bin/env node | |
| /** | |
| * Portable stacktrace remapper for Node.js, Bun, and Deno (with --compat). | |
| * Usage: | |
| * bun run remap.ts <stacktrace-file> | |
| * node --experimental-fetch remap.ts <stacktrace-file> | |
| * deno run --compat --allow-net --allow-read remap.ts <stacktrace-file> | |
| */ |
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} from 'fs'; | |
| const args = process.argv.slice(2); | |
| const clientIdIndex = args.indexOf('--client_id'); | |
| const clientSecretIndex = args.indexOf('--client_secret'); | |
| const subjectIndex = args.indexOf('--subject'); | |
| const fromAddressIndex = args.indexOf('--from_address'); | |
| const delayIndex = args.indexOf('--delay'); | |
| if (clientIdIndex === -1 || clientSecretIndex === -1 || subjectIndex === -1 || fromAddressIndex === -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
| #!/bin/bash | |
| # Use first argument as directory, default to current directory if not provided | |
| IMAGE_DIR=${1:-$(pwd)} | |
| # Change to the directory | |
| cd "$IMAGE_DIR" | |
| # Loop through HEIC, heic, JPG, and jpg files | |
| for file in *.[hH][eE][iI][cC] *.[jJ][pP][gG] *.[jJ][pP][eE][gG]; do |
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 {readdirSync, readFileSync, writeFileSync} from 'fs'; | |
| import {resolve} from 'path'; | |
| import * as ts from 'typescript'; | |
| /// original action class name to type enum | |
| const actionMapping = new Map<string, {enumType: string; constructorParams: Param[]}>(); | |
| /// this matches only a limited nesting of brackets - it uses lookaheads as performance fix for catastrophic backtracking: | |
| const bracketMatcherPart = '\\(((?:[^()]*(?=[()])|\\((?:[^()]*(?=[()])|\\((?:[^()]*(?=[()])|\\((?:[^()]*(?=[()])|\\([^()]*(?=[()])\\))*\\))*\\))*\\))*)\\)'; |
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
| # see https://community.home-assistant.io/t/close-open-curtain-cover-blinds-based-on-sun-and-weather/584240 | |
| blueprint: | |
| name: cover sun | |
| description: Close cover when sun is shining and open when stops. This considers weather (sunny, partly cloudy), sun position (elevation, azimuth) and temperature. | |
| domain: automation | |
| source_url: https://gist.github.com/daniel-sc/074465be04dd9a793cba5b841ab63f83 | |
| input: | |
| cover_entity: | |
| name: cover |
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 { Application, Router } from 'https://deno.land/x/oak/mod.ts'; | |
| // Load environment variables | |
| const PORT = 8080; | |
| const TEAMS_WEBHOOK_URL = 'https://XYZ.webhook.office.com/webhookb2/XYZ'; | |
| const TARGET_USERNAME = 'xyz'; | |
| if (!TEAMS_WEBHOOK_URL || !TARGET_USERNAME) { | |
| throw new Error('Missing required environment variables.'); | |
| } |
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 minCharCode = Math.min(...'aAzZ019-_.:,'.toUpperCase().split('').map(c => c.charCodeAt(0))); | |
| const maxCharCode = Math.max(...'aAzZ019-_.:,'.toUpperCase().split('').map(c => c.charCodeAt(0))); | |
| const alphabetSize = maxCharCode - minCharCode + 2; | |
| console.log(minCharCode, maxCharCode, alphabetSize, Number.MAX_SAFE_INTEGER, Number.MIN_SAFE_INTEGER); | |
| function toNumber(char) { | |
| return char.toUpperCase().charCodeAt(0) - minCharCode + 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
| // This script loops though all collections of all db in a MongoDB and runs the compact operation on them | |
| // Simply paste this into the Mongo shell | |
| db.getMongo().setReadPref('secondary'); | |
| db.getMongo().getDBNames().forEach(function(dbName) { | |
| if (["local", "admin", "system", "config"].indexOf(dbName) < 0 /* && dbName > "config"*/) { | |
| var subject = db.getSiblingDB(dbName); | |
| subject.getCollectionNames() | |
| .filter(c => ['system.users', 'system.roles'].indexOf(c) < 0) | |
| .forEach(function (collectionName) { |
NewerOlder