Skip to content

Instantly share code, notes, and snippets.

@arthurafarias
arthurafarias / README.md
Last active January 25, 2026 09:45
Encoding URI and URI Component in C++

Encode and Decode HTTP URIs and URI components in C++

What is a URI?

A Uniform Resource Identifier (URI) is a string of characters that unambiguously identifies a particular resource. To guarantee uniformity, all URIs follow a predefined set of syntax rules,[1] but also maintain extensibility through a separately defined hierarchical naming scheme (e.g. "http://").

Such identification enables interaction with representations of the resource over a network, typically the World Wide Web, using specific protocols. Schemes specifying a concrete syntax and associated protocols define each URI. The most common form of URI is the Uniform Resource Locator (URL), frequently referred to informally as a web address. More rarely seen in usage is the Uniform Resource Name (URN), which was designed to complement URLs by providing a mechanism for the identification of resources in particular namespaces.

The common parts of a URI are described below.

@bassemawhoob
bassemawhoob / factory_bot_console.rb
Last active January 25, 2026 09:44
Using FactoryBot in Rails console
# Source: https://stackoverflow.com/questions/18195851/how-do-i-use-factories-from-factorybot-in-rails-console
require 'factory_bot'
include FactoryBot::Syntax::Methods
@cpt9m0
cpt9m0 / tcpdump_top_countries.sh
Last active January 25, 2026 09:42
TCPDump Top Countries Useful for Conduit
#!/usr/bin/env bash
set -euo pipefail
CAPTURE_SECONDS="${CAPTURE_SECONDS:-15}"
TOP_N="${TOP_N:-25}"
echo "=== Conduit Country Tracker (Top Countries) ==="
echo ""
echo "[1/4] Installing required tools..."
@rtm516
rtm516 / Bedrock new XVC download system.md
Last active January 25, 2026 09:39
Bedrock new XVC download system

Bedrock new XVC download system

As of Bedrock Preview 1.21.120.21 minecraft is using the new Game Development Kit and moving away from UWP. They are nolonger packaged as APPX but instead as MSIXVC which requires a new way of fetching and is far easier than previous methods but requires authentication. This hopefully will explain how to download the new format.

Quick ref

Product PackageId ProductId ContentId
Minecraft Bedrock Microsoft.MinecraftUWP 9NBLGGH2JHXJ 7792d9ce-355a-493c-afbd-768f4a77c3b0
Minecraft Preview Microsoft.MinecraftWindowsBeta 9P5X4QVLC2XR 98bd2335-9b01-4e4c-bd05-ccc01614078b

Get the content ID

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active January 25, 2026 09:39
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:
KFZUS-F3JGV-T95Y7-BXGAS-5NHHP
T3ZWQ-P2738-3FJWS-YE7HT-6NA3K
KFZUS-F3JGV-T95Y7-BXGAS-5NHHP
65Z2L-P36BY-YWJYC-TMJZL-YDZ2S
SFZHH-2Y246-Z483L-EU92B-LNYUA
GSZVS-5W4WA-T9F2E-L3XUX-68473
FTZ8A-R3CP8-AVHYW-KKRMQ-SYDLS
Q3ZWN-QWLZG-32G22-SCJXZ-9B5S4
DAZPH-G39D3-R4QY7-9PVAY-VQ6BU
KLZ5G-X37YY-65ZYN-EUSV7-WPPBS
@ahmednawazkhan
ahmednawazkhan / installing-cpp-on-windows.md
Last active January 25, 2026 09:31
Install C++/Mingw-w64/g++ on windows

Installing C++/g++/Mingw-w64 on Windows

  1. Install Msys2 from msys2.org
  2. Complete the steps and open Msys2
  3. Update package databases pacman -Syu
  4. Update rest of base packages pacman -Su
  5. Install Mingw-w64 pacman -S --needed base-devel mingw-w64-x86_64-toolchain
  6. Install CMake pacman -S mingw-w64-x86_64-cmake
  7. Install Ninja pacman -S mingw-w64-x86_64-ninja
  8. Make sure to launch MSYS2 MinGW 64-bit with administrator rights ( This is !mportant...!!!)
@stormwild
stormwild / visual-studio.md
Last active January 25, 2026 09:29
Visual Studio

Visual Studio

Integrating Git Bash with Visual Studio - Stack Overflow

  1. Select View > Terminal from the main menu.
  2. Click on the gear icon in the upper right corner of the terminal window.
  3. In the Options window, select Environment > Terminal.
  4. In the Profiles section, click the Add button.
  5. Use the following values for the new profile:
  • Name: Git Bash