Skip to content

Instantly share code, notes, and snippets.

// Please find the full, tested version in
// https://github.com/influxdata/influxdb_iox/blob/fe155e15fb2ad166aee66b0458e63c24a8128dd4/query/src/exec/task.rs#L101-L118
pub struct DedicatedExecutor {
state: Arc<Mutex<State>>,
}
/// Runs futures (and any `tasks` that are `tokio::task::spawned` by
/// them) on a separate Tokio Executor
struct State {
@Maxiviper117
Maxiviper117 / caddy-php-serve.md
Last active July 17, 2025 14:09
HTTPS for `php artisan serve` on WSL2 via Caddy reverse proxy with auto‑trusted certs.

Prerequisites

  • Windows 10/11 with WSL 2 and your Laravel project working under WSL.
  • Chocolatey installed on Windows (for easy Caddy install).
  • A .test (or similar) hostname mapped to 127.0.0.1 (we’ll set that up below).

1. Install Caddy on Windows

@mapster
mapster / Readme.md
Last active July 17, 2025 14:09
Export Google Authenticator secret OTP-keys

Export Google Authenticator secret OTP-keys

I recently got myself a Yubikey and wanted to set up the Yubico Authenticator with all the OTPs I had in Google Authenticator. Unfortunately Yubico Authenticator doesn't support scanning the QR-code that the Google Authenticator generates when you export the OTP-keys, and it seemed like quite the daunting task to log in to every service to generate new OTP-keys. So I decided to have a look at the contents of the QR code, to see if I could import the keys into Yubico Authenticator in one go. Luckily I found a blog post by Alex Bakker that describes the data format.

Transfer QR-code to computer

Unfortunately, but likely for the best, the security policy of Google Authenticator won't allow you to take a screenshot of

ARMv8.3 Pointer Authentication in xnu

Introduction

This document describes xnu's use of the ARMv8.3-PAuth extension. Specifically, xnu uses ARMv8.3-PAuth to protect against Return-Oriented-Programming (ROP) and Jump-Oriented-Programming (JOP) attacks, which attempt to gain control flow over a victim program by overwriting return addresses or function pointers

@code-boxx
code-boxx / 0-JS-VIDEO-PLAYLIST.MD
Created June 12, 2023 01:55
Javascript Video Player With Playlist

I want to solve the following problem, but I’m stuck.
Please act as a “cognitive centrifuge.”

  1. Break the problem into exactly four numbered sub-problems.
  2. For each sub-problem, give me one concrete micro-action I can do in under 2 minutes that will either (a) make the problem smaller, or (b) give me new information.
  3. After the four micro-actions, add a one-line “momentum booster” I can say out loud to prime my brain to keep going.
  4. Format the whole thing so I can read it in <15 seconds.

Problem:

@spicycode
spicycode / myweechat.md
Last active July 17, 2025 14:03 — forked from pascalpoitras/1.md
My always up-to-date WeeChat configuration (weechat-dev)

WeeChat Screenshot

Enable mouse support

/mouse enable

Encrypted password in sec.conf

@33eyes
33eyes / commit_jupyter_notebooks_code_to_git_and_keep_output_locally.md
Last active July 17, 2025 14:02
How to commit jupyter notebooks without output to git while keeping the notebooks outputs intact locally

Commit jupyter notebooks code to git and keep output locally

  1. Add a filter to git config by running the following command in bash inside the repo:
git config filter.strip-notebook-output.clean 'jupyter nbconvert --ClearOutputPreprocessor.enabled=True --to=notebook --stdin --stdout --log-level=ERROR'  
  1. Create a .gitattributes file inside the directory with the notebooks

  2. Add the following to that file:

@antlionguard
antlionguard / twitter-remove-retweets.js
Last active July 17, 2025 14:01
With this script, you can remove all retweets you are retweeted on Twitter.
const timer = ms => new Promise(res => setTimeout(res, ms));
// Unretweet normally
const unretweetTweet = async (tweet) => {
await tweet.querySelector('[data-testid="unretweet"]').click();
await timer(250);
await document.querySelector('[data-testid="unretweetConfirm"]').click();
console.log('****// Unretweeted Successfully //****')
}
@htv2012
htv2012 / json_duplicate_keys_detection.py
Last active July 17, 2025 13:58
How to detect duplicate keys when decoding JSON string
import json
import collections
json_string = """
{
"a": 1,
"a": 2,
"b": [1,2,3],
"b": "foo",
"c": {"x":1, "y":2, "z":3, "a":4}