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
#!/bin/bash | |
# Replace these with your Pushover credentials | |
APP_TOKEN="your_app_token" | |
USER_KEY="your_user_key" | |
# Expected IP addresses | |
EXPECTED_IP_A="your_expected_ipv64_address" | |
EXPECTED_IP_AAAA="your_expected_ipv6_address" |
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 node | |
import puppeteer from "puppeteer"; | |
import { URL } from "url"; | |
import yargs from "yargs"; | |
import { hideBin } from "yargs/helpers"; | |
import fs from "fs"; | |
import path from "path"; | |
const INDENT = " "; |
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
.container-grid { | |
--columns: 6; | |
--gap: 1.5rem; | |
position: relative; | |
overflow: hidden; | |
display: grid; | |
grid-template-columns: repeat(var(--columns), 1fr); | |
grid-column-gap: var(--gap); |
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 bash | |
# Convert a video to HLS format with multiple resolutions | |
# Usage: ./convert.sh input.mp4 | |
# current version: | |
# https://gist.github.com/signalwerk/5eaddbd2825501e4ea61784efbf84a31 | |
# for more complex converting see also | |
# https://gist.github.com/mrbar42/ae111731906f958b396f30906004b3fa |
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
import { useState, useEffect } from "react"; | |
const useFetch = (url, options) => { | |
const [response, setResponse] = useState(null); | |
const [error, setError] = useState(null); | |
const [loading, setLoading] = useState(false); | |
const abortController = new AbortController(); // Move abortController outside useEffect | |
useEffect(() => { | |
const signal = abortController.signal; |
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
#!/bin/bash | |
# run | |
# bash <(curl https://gist.githubusercontent.com/signalwerk/7b4411c13073da371b5d3d5d4d73cc9b/raw/count.sh) | |
# Define the output CSV file | |
output_csv="code_lines.csv" | |
# Header for the CSV file | |
echo "Commit,Year,Month,Date,Total Lines,Largest File" > "$output_csv" |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Marc Rudin</title> | |
<style> | |
body, | |
html { | |
margin: 0; | |
padding: 0; | |
height: 100%; |
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
// Latest Vesrsion | |
// curl https://gist.githubusercontent.com/signalwerk/9802b92b6606d4ec2aca58d8f0def4be/raw/form.js > form.js | |
// | |
// Example: | |
// | |
// document.addEventListener("DOMContentLoaded", (event) => { | |
// const formCondition = document.querySelector("input[id$=condition]"); | |
// if (formCondition) { | |
// form(JSON.parse(formCondition.value)); | |
// } |
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
// HTML to YAML Extractor and Updater | |
/** | |
* A tool to extract content from HTML, convert it to YAML, and update HTML content from YAML files. | |
*/ | |
import cheerio from "cheerio"; | |
import { promises as fs } from "fs"; | |
import path from "path"; | |
import yaml from "js-yaml"; |
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 code sends a prompt to the OpenAI API and then outputs the response | |
// to the terminal and to a file. | |
// Setup: | |
// npm init -y && npm i dotenv node-fetch | |
// echo "OPENAI_API_KEY=sk-XXX" > .env | |
import fs from "fs"; | |
import fetch from "node-fetch"; | |
import * as dotenv from "dotenv"; |
NewerOlder