Skip to content

Instantly share code, notes, and snippets.

OrionReed / dom3d.js
Last active June 21, 2024 14:11
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 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 (
(() => {
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 (
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
maxpert / .dockerignore
Last active January 22, 2024 14:01
Marmot + PocketBase +
LuckyGeck /
Last active December 17, 2023 06:54
Tailscale exit node on
jaymecd /
Last active October 27, 2017 20:26
Build Caddy w/ plugins from sources
#!/usr/bin/env bash
# Author: @nikolaizujev
# Big respect to @mholt6 for making Caddy
# This script is based on:
# -
# -
lyoshenka / tx.go
Created September 4, 2017 20:59
A simple, neat way to wrap code in an sql transaction with proper committing/rollbacking and error handling.
// TxFunc is a function that can be wrapped in a transaction
type TxFunc func(tx *sql.Tx) error
// WithTx wraps a function in an sql transaction. After the function returns, the transaction is
// committed if there's no error, or rolled back if there is one.
func WithTx(db *sql.DB, f TxFunc) (err error) {
tx, err := db.Begin()
if err != nil {
return err
ethack /
Last active June 21, 2024 09:56
Scripts that simulate typing the clipboard contents. Useful when pasting is not allowed.

It "types" the contents of the clipboard.

Why can't you just paste the contents you ask? Sometimes pasting just doesn't work.

  • One example is in system password fields on OSX.
  • Sometimes you're working in a VM and the clipboard isn't shared.
  • Other times you're working via Remote Desktop and again, the clipboard doesn't work in password boxes such as the system login prompts.
  • Connected via RDP and clipboard sharing is disabled and so is mounting of local drives. If the system doesn't have internet access there's no easy way to get things like payloads or Powershell scripts onto it... until now.


The Windows version is written in AutoHotKey and easily compiles to an executable. It's a single line script that maps Ctrl-Shift-V to type the clipboard.

tonysneed / Mac OS X: Open in Visual Studio Code
Last active June 14, 2024 04:16
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "" --args "$*"
- Save it as something like "Open in Visual Studio Code"
dmlyons /
Last active August 29, 2015 14:20
A bash-completion script that will allow you to jump to specific go source directories with tab completion
function godir {
if [ -z "$1" ]
cd $GOPATH/src
if [ "$1" == "reload" ]
_go_package_names=( $(go list all) )
cd $GOPATH/src/$1
olov / gist:eb60ab878eb73a7c5e22
Created October 15, 2014 08:55
// You don't want to serve HTTPS supporting for SSL3.0 any longer, see:
import (
// This code supports SSL3.0, TLS1.0, TLS1.1 and TLS1.2
// Chances are you currently do this but want to stop due to the POODLE
err := http.ListenAndServeTLS(addr, "crtfile", "keyfile", handler)
KdotJPG /
Last active June 19, 2024 15:44
Visually isotropic coherent noise algorithm based on alternate constructions of the A* lattice.
* K.jpg's OpenSimplex 2, smooth variant ("SuperSimplex")
* More language ports, as well as legacy 2014 OpenSimplex, can be found here:
public class OpenSimplex2S {
private static final long PRIME_X = 0x5205402B9270C86FL;