Skip to content

Instantly share code, notes, and snippets.

// SPDX-License-Identifier: MIT
// This doesn't work properly in all cases. You would be better off using https://gist.github.com/Alyinghood/21bdb81d6f83114604082bd019482ae3 instead
// See https://forums.nrvnqsr.com/showthread.php/9708-Mahoutsukai-no-Yoru-HD-PC-file-format-deciphering
#include <string.h>
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdint.h>
@Windows10CE
Windows10CE / CSharpIOStream.cs
Last active January 4, 2024 08:26
C# iostream
using System;
using System.Reflection;
using System.Diagnostics;
int a = default;
string s = default;
_ = Std.In >> __makeref(a) >> __makeref(s);
_ = Std.Out << a << s << "\n";
public static unsafe class Std
@BigBang1112
BigBang1112 / ImportMapFileGhidra.md
Last active July 22, 2026 05:14
Quick tutorial how to connect .map file with .exe in Ghidra.
  1. Import your desired .EXE and open it
  2. Don't analyze the project just yet
  3. Go File -> Add To Program...
  4. Add the .map file, then click Ok. This will add the symbols.
  5. To demangle the symbols, go to Script Manager, search for DemangleAllScript.java and run it. This script also analyzes the project.
@EgorBo
EgorBo / jit-diffs for changes in C# code.md
Last active January 16, 2023 18:29
jit-diffs for changes in C# code.md

How to run jit-diffs for changes in the managed code

All commands are in powershell, should be pretty much the same for bash and non-windows platforms

  1. build everything we're going to need:
.\build.cmd Clr+Libs -c Release ;; .\build.cmd Clr -c Checked ;; cd .\src\tests\ ;; .\build.cmd Release generatelayoutonly ;; cd ..\..
  1. Make a copy of the test core_root (will be a baseline):
@maxidorius
maxidorius / matrix-howto-synapse_coturn.md
Last active August 21, 2025 18:38
Working config for VoIP in Matrix: synapse + coturn

This configuration is provided AS-IS and as an example/reference for those who do not find a working configuration for themselves. It is not always kept up to date and no support is provided.

Assuming:

  • Your Matrix domain: example.org
  • Your TURN domain (arbitrary): turn.example.org
  • Your Public IP: 1.2.3.4
  • Your Private IP for the box hosing the services: 10.11.12.13
  • A shared secret between synapse and coturn: ThisIsASharedSecret-ChangeMe
  • You want Firefox compatiblity (TURNS only is not supported)
@GrabYourPitchforks
GrabYourPitchforks / memory_docs_samples.md
Last active April 3, 2026 16:09
Memory<T> API documentation and samples

Memory<T> API documentation and samples

This document describes the APIs of Memory<T>, IMemoryOwner<T>, and MemoryManager<T> and their relationships to each other.

See also the Memory<T> usage guidelines document for background information.

First, a brief summary of the basic types

  • Memory<T> is the basic type that represents a contiguous buffer. This type is a struct, which means that developers cannot subclass it and override the implementation. The basic implementation of the type is aware of contigious memory buffers backed by T[] and System.String (in the case of ReadOnlyMemory<char>).
@nrollr
nrollr / nginx.conf
Last active August 25, 2026 11:32
NGINX config for SSL with Let's Encrypt certs
# UPDATED 17 February 2019
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
listen [::]:80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
}
# SSL configuration
@aras-p
aras-p / preprocessor_fun.h
Last active August 15, 2026 15:30
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,