Skip to content

Instantly share code, notes, and snippets.

View signalwerk's full-sized avatar
💫
on the r͢oad

Stefan Huber signalwerk

💫
on the r͢oad
View GitHub Profile
@signalwerk
signalwerk / OpenSource.md
Created April 4, 2025 08:46
Provides recommended usage guidelines for the term “open source” in English and German.

Recommendation for the Term “open source”

When the term is used as a noun, “open source” is recommended. When it is used as an adjective (a compound modifier), “open-source software” is recommended. The adjective “open-sourced” is not recommended. This usage follows common practice rather than the Oxford English Dictionary. The term “open source” is strictly recommended for free software as defined by The Open Source Initiative (OSI) and reviewed and approved by them.

  • open source
  • open-source
  • OpenSource
  • open-source software
  • open-source-software
  • open source software
@signalwerk
signalwerk / getCSV.js
Created March 25, 2025 16:00
Export HTML Table to CSV
(function () {
// Option to toggle including hidden text in the CSV.
// When true, hidden text is included using textContent;
// When false, only visible text is included using innerText.
const includeHiddenText = true;
// Get all tables on the page.
const tables = document.querySelectorAll("table");
if (!tables.length) {
@signalwerk
signalwerk / monitor-dns-during-go-live.sh
Last active April 4, 2025 09:36
DNS Monitoring Script for Go-Live Moments
#!/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"
@signalwerk
signalwerk / index.mjs
Last active October 18, 2024 06:46
CLI screenshot helper
#!/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 = " ";
@signalwerk
signalwerk / grid.scss
Last active June 3, 2024 15:46
Draw the columns of a grid in the background
.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);
@signalwerk
signalwerk / convert.sh
Last active April 24, 2024 22:29
Convert a video to HLS format with multiple resolutions
#!/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
@signalwerk
signalwerk / useFetch.js
Created January 10, 2024 22:59
Fetch a JSON and have the option to chancel the request
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;
@signalwerk
signalwerk / count.sh
Last active August 8, 2023 15:53
Count code lines in git repo
#!/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"
@signalwerk
signalwerk / index.html
Last active November 30, 2024 14:24
Slideshow for Marc Rudin
<!DOCTYPE html>
<html>
<head>
<title>Marc Rudin</title>
<style>
body,
html {
margin: 0;
padding: 0;
height: 100%;
@signalwerk
signalwerk / form.js
Last active May 21, 2023 22:47
Conditional form handling based on JSON-Definiton
// 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));
// }