Skip to content

Instantly share code, notes, and snippets.

Two pointers: one input, opposite ends
```python3
def fn(arr):
left = ans = 0
right = len(arr) - 1
while left < right:
# do some logic here with left and right
if CONDITION:
@maple3142
maple3142 / CVE-2025-55182.http
Last active December 14, 2025 01:36
CVE-2025-55182 React Server Components RCE POC
POST / HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Next-Action: x
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Length: 459
------WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Disposition: form-data; name="0"
@superjamie
superjamie / install-ubuntu-luks-lvm.md
Last active December 14, 2025 01:28
How to install Ubuntu with LUKS Encryption on LVM

How to install Ubuntu with LUKS Encryption on LVM

My work requires us to have full-disk encryption, so these are the steps I use.

The basic idea is to create a LUKS-encrypted partition which is used as an LVM Physical Volume.

The GRUB boot partition isn't encrypted, but everything else is.

These steps tested and working on 22.04 (jammy) and 20.04 (focal).

@nickav
nickav / ReadDirectoryChangesW_craziness.cpp
Last active December 14, 2025 01:22
Example of how to poll ReadDirectoryChangesW on Windows
int main() {
char *path = "/path/to/my/directory";
print("watching %s for changes...\n", path);
HANDLE file = CreateFile(path,
FILE_LIST_DIRECTORY,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
NULL,
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED,
/*
* Copyright (C) Grabsky ([email protected])
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License v3 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@nikoheikkila
nikoheikkila / README.md
Last active December 14, 2025 01:16
Fish Shell function for sourcing standard .env files

envsource

⚠️ NOTE (20.5.2023): I don't really use this function at all anymore since there are now tools such as Taskfile, which reads the .env file for me sparing me the need to pollute my session with environment variables.


I've been using Fish shell for years which is great and all, but one thing that has got me frustrated is using it with .env files.

When attempting to run source .env in a project, I usually encounter this problem:

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active December 14, 2025 01:15
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This does not works in browser for quests which require you to play a game! Use the desktop app to complete those.

How to use this script:

  1. Accept a quest under Discover -> Quests
  2. Press Ctrl+Shift+I to open DevTools
  3. Go to the Console tab
  4. Paste the following code and hit enter:
@rpavlik
rpavlik / settings.json
Last active December 14, 2025 01:13
Go away copilot and other slop machines (in vscode)
{
// go away copilot and other ai slop machines
"accessibility.verbosity.inlineChat": false,
"accessibility.verbosity.panelChat": false,
"ansible.lightspeed.suggestions.waitWindow": 360000,
"chat.agent.enabled": false,
"chat.agent.maxRequests": 0,
"chat.commandCenter.enabled": false,
"chat.detectParticipant.enabled": false,
"chat.disableAIFeatures": true,
@clayton
clayton / SKILL.md
Created December 13, 2025 23:30
Claude Code Skill for using AXe