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
| // 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
| // You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
| (() => { | |
| const SHOW_SIDES = false; // color sides of DOM nodes? | |
| const COLOR_SURFACE = true; // color tops of DOM nodes? | |
| const COLOR_RANDOM = false; // randomise color? | |
| const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
| const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
| const THICKNESS = 20; // thickness of layers | |
| const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
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
| """A simple wrapper for prefect server, with apikey and basic auth check. | |
| usage: | |
| ```bash | |
| # Allow prefect cli to access the server with same PREFECT_API_KEY. | |
| PREFECT_API_KEY=XX | |
| # base64 encoded `username:password`. Allow users to access the server with user:password. | |
| PREFECT_BASIC_AUTH=XX | |
| # start server | |
| uvicorn --host $PREFECT_SERVER_API_HOST --port $PREFECT_SERVER_API_PORT --factory server:create_auth_app |
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
| FROM azul/zulu-openjdk:17 AS builder | |
| RUN apt-get update \ | |
| && apt-get install -y --no-install-recommends git libprotobuf-dev \ | |
| && git clone -b development --depth 1 https://github.com/Grasscutters/Grasscutter /work | |
| WORKDIR /work | |
| RUN export GRADLE_OPTS="-Dfile.encoding=utf-8" \ | |
| && git submodule update --init \ |
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/zsh | |
| # Tiktok speech to text parser | |
| # by hugeblank, April 2022 | |
| # API endpoint & oneshot reading and playing discovered by @scanlime | |
| # https://twitter.com/scanlime/status/1512288857596653568 | |
| # First argument - string of text to read | |
| # Second argument - voice to use | |
| # Usage examples: |
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
| FROM quay.io/keycloak/keycloak:17.0.0 as builder | |
| ENV KC_METRICS_ENABLED=true | |
| ENV KC_FEATURES=preview | |
| ENV KC_DB=postgres | |
| ENV KC_HTTP_RELATIVE_PATH=/auth | |
| # specify the custom cache config file here | |
| ENV KC_CACHE_CONFIG_FILE=cache-ispn-jdbc-ping.xml | |
| # copy the custom cache config file into the keycloak conf dir |
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
| set @bkpdir := '/home/root/backup'; | |
| set @dtdir := '/var/lib/mysql'; | |
| set @usr := 'mysql:mysql'; | |
| -- !@#$%^&*()-=+_.,;:"'\/ | |
| DROP FUNCTION IF EXISTS TBL_TO_MYSQL_FILENAME; | |
| CREATE FUNCTION TBL_TO_MYSQL_FILENAME(s TEXT) RETURNS TEXT DETERMINISTIC | |
| RETURN | |
| REPLACE( | |
| REPLACE( |
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 | |
| set -e | |
| cf_ips() { | |
| echo "# https://www.cloudflare.com/ips" | |
| for type in v4 v6; do | |
| echo "# IP$type" | |
| curl -sL "https://www.cloudflare.com/ips-$type/" | sed "s|^|allow |g" | sed "s|\$|;|g" |
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 bash | |
| # | |
| # Usage: dev_signed_cert.sh HOSTNAME | |
| # | |
| # Creates a CA cert and then generates an SSL certificate signed by that CA for the | |
| # given hostname. | |
| # | |
| # After running this, add the generated dev_cert_ca.cert.pem to the trusted root | |
| # authorities in your browser / client system. | |
| # |
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 | |
| # Example for the Docker Hub V2 API | |
| # Returns all images and tags associated with a Docker Hub organization account. | |
| # Requires 'jq': https://stedolan.github.io/jq/ | |
| # set username, password, and organization | |
| UNAME="" | |
| UPASS="" | |
| ORG="" |
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
| #include "uart.h" | |
| #include <sys/types.h> | |
| #include <sys/stat.h> | |
| #include <termios.h> | |
| #include <fcntl.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> |
NewerOlder