Skip to content

Instantly share code, notes, and snippets.

@opencoca
opencoca / experimenting-with-hyperscript-startr-style-system7-style-24-9-21.markdown
Created September 21, 2023 15:25
Experimenting with Hyperscript, Startr Style, System7 Style 24-9-21
@lysender
lysender / hyperscript-toggle-burger-menu.md
Created August 17, 2023 16:41
hyperscript - Toggle Hamburger Menu for mobile browsers

How to toggle hamburger menu on/off in hyperscript?

I used this JavaScript solution earlier - https://gist.github.com/lysender/bc9800e6350e1ccfab3c6ce6934b1cd2

However, I realized it is way more simple to just use hyperscript.

What it does is toggle the is-active class on two divs related to the navigation menu.

No need to write the complicated JavaScript code but we do need to include the hyperscript JavaScript file in our page.

@mattdesl
mattdesl / cli.js
Created September 13, 2022 10:37
colour palette from text prompt using Stable Diffusion https://twitter.com/mattdesl/status/1569457645182152705
/**
* General-purpose NodeJS CLI/API wrapping the Stable-Diffusion python scripts.
*
* Note that this uses an older fork of stable-diffusion
* with the 'txt2img.py' script, and that script was modified to
* support the --outfile command.
*/
var { spawn, exec } = require("child_process");
var path = require("path");
@Trenly
Trenly / README.md
Last active March 4, 2025 01:45
Install Winget to the Windows Sandbox Base Image

This powershell script modifies the Base Image, or the Virtual Hard Disk, which the Windows Sandbox launches upon startup. It will copy the required files to the sandbox and add a registry key which will install them upon startup. By default the script will install the latest stable release of Winget. You can specify to use the latest pre-release with the -PreRelease switch.

When a new version of Winget is released, run this script again to update the installation in the sandbox to the latest version

@cemerson
cemerson / archive.org-scanned-book-downloader-bookmarklet.md
Last active February 21, 2025 00:22
Archive.org Scanned Book Downloader Bookmarklet

Archive.org Scanned Book Downloader Bookmarklet

A simple "1-click" javascript approach to downloading a scanned book from archive.org to read at your leisure on the device of your choosing w/out having to manually screenshot every pages of the book by hand. In short it's a glorified "Save Image As..." approach but consolidated down to "1 click". BTW there may be a much better option than this out there - I just built this as an autistic project to see if it would work.

Demo Video

Archive.org SBDL Demo

Obligatory Legal/Disclaimer:

By using this script you agree to delete all book files/images after your 1 hour or 14 days is up! I don't support using this script for any other use cases. After all, none of us have ever kept a library book past it's return date, right?

@davidfowl
davidfowl / MinimalAPIs.md
Last active March 4, 2025 22:18
Minimal APIs at a glance
@Jiab77
Jiab77 / create-DNS-over-TLS-bridge-with-pi-hole-unbound-and-stubby-on-ubuntu-server.md
Last active September 7, 2024 10:40
Few months ago, I've made a similar work but I wanted something a little more easier to manage. Please have a look at here for my previous work.

Create DNS-over-TLS bridge with Pi-hole, unbound and stubby on Ubuntu Server

Few months ago, I've made a similar work but I wanted something a little more easier to manage. Please have a look at here for my previous work.

This time, I'm gonna do pretty much the same thing but using Pi-hole as base then modify it to include unbound and stubby.

This way, I can use the power of Pi-hole with some additional security layers:

  • Recursive DNS check (unbound)
  • DNS-over-TLS (stubby)
@csswizardry
csswizardry / nesting.css
Created February 25, 2021 16:49
DOM Depth Visualiser
/**
* Tier 1 – Dotted
*/
* { outline: 2px dotted purple; }
* * { outline: 2px dotted blue; }
* * * { outline: 2px dotted green; }
* * * * { outline: 2px dotted yellow; }
* * * * * { outline: 2px dotted orange; }
* * * * * * { outline: 2px dotted red; }
@5t3ph
5t3ph / element-classes-and-ids-vanilla.css
Last active January 25, 2022 04:06
Tag HTML elements with their class names and IDs to visualize page structure
*[class],
*[id] {
position: relative;
outline: 2px dashed red;
}
*[class]::before, *[class]::after,
*[id]::before,
*[id]::after {
position: absolute;

Rkhunter (Rootkit Hunter) Installation and Monitoring for Linux.md

Last Updated 2020-04-13 by Kevin Roth

Detection of rootkit and other intrusions for Linux with rkhunter. Installation and nightly email reports.

Install rkhunter

$ sudo yum install rkhunter