Skip to content

Instantly share code, notes, and snippets.

@thomasdarimont
thomasdarimont / Continuation.java
Last active April 30, 2024 19:55
Java21 Continuations Demo
package demo.cont;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.util.function.Consumer;
public final class Continuation {
private final Object delegate;
@ConnerWill
ConnerWill / ANSI-escape-sequences.md
Last active April 30, 2024 19:54
ANSI Escape Sequences cheatsheet

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@roymckenzie
roymckenzie / wpdebug.sh
Created April 24, 2024 01:15
wpdebug.sh - WordPress Debugging Shell Script
#!/bin/bash
# Script Name: Script Name: wpdebug.sh
# Description: A script for enabling or disabling WordPress debugging mode in the wp-config.php file.
# Author: Roy McKenzie
# Date: April 23, 2024
# Version: 1.0
#
# Usage: ./wpdebug.sh [install|uninstall|enable|disable|tail|delete]
#
# Options:

Container Images

Kubernetes

Verify single image

$ cosign verify registry.k8s.io/kube-apiserver-amd64:v1.25.2

Get and Verify All Kubernetes Images

$ version=v1.25.0
curl -Ls https://sbom.k8s.io/v1.25.0/release \
@dotja
dotja / drf-api-swagger-doc.md
Last active April 30, 2024 19:52
Django REST Framework API documentation using Swagger

API Documentation with DRF and Swagger

Overview:

  • We need to create a schema. The schema outlines all the endpoints and actions of our API.

  • We need to create the documentation that is a more human-readable form of the schema.

Steps:

@bradtraversy
bradtraversy / docker_wordpress.md
Last active April 30, 2024 19:51
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@h3r2tic
h3r2tic / restir-meets-surfel-lighting-breakdown.md
Created November 23, 2021 02:15
A quick breakdown of lighting in the `restir-meets-surfel` branch of my renderer

A quick breakdown of lighting in the restir-meets-surfel branch of my renderer, where I revive some olde surfel experiments, and generously sprinkle ReSTIR on top.

General remarks

Please note that this is all based on work-in-progress experimental software, and represents a single snapshot in development history. Things will certainly change 😛

Due to how I'm capturing this, there's frame-to-frame variability, e.g. different rays being shot, TAA shimmering slightly. Some of the images come from a dedicated visualization pass, and are anti-aliased, and some show internal buffers which are not anti-aliased.

Final images

@edjdavid
edjdavid / file.md
Created October 13, 2022 12:45
Stream Windows webcam/desktop via RTSP

Can be used for streaming data (webcam or screen capture) from the Windows to WSL

Install

  1. Simple RTSP Server
  2. ffmpeg

Get the internal IP of WSL

Run from a WSL terminal

ip route list default | awk '{print $3}'
@nfsarmento
nfsarmento / nginx-wordpress.conf
Last active April 30, 2024 19:49
Harden wordpress security nginx
############ WordPress ####################
# Disable logging for favicon and robots.txt
location = /favicon.ico {
try_files /favicon.ico @empty;
access_log off;
log_not_found off;
expires max;
}
/*
* spi_max7221.c
*
* Created: 7/14/2020 8:49:34 PM
* Author : https://aki-technical.blogspot.com
*/
#include <avr/io.h>
#define F_CPU 4000000UL