Skip to content

Instantly share code, notes, and snippets.

SOLVED

C++ speed +- equal to Rust

BUILD

RUST

$ rustc -O partition.rs

C++

@mwaskom
mwaskom / replacing_seaborn_distplot.ipynb
Last active July 18, 2025 05:29
A guide to replacing the deprecated `seaborn.distplot` function.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@float3
float3 / LICENSE
Last active June 6, 2025 22:28
ShaderPreprocessor
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
@kkrypt0nn
kkrypt0nn / ansi-colors-discord.md
Last active August 19, 2025 09:28
A guide to ANSI on Discord

A guide to ANSI on Discord

Discord is now slowly rolling out the ability to send colored messages within code blocks. It uses the ANSI color codes, so if you've tried to print colored text in your terminal or console with Python or other languages then it will be easy for you.

Quick Explanation

To be able to send a colored text, you need to use the ansi language for your code block and provide a prefix of this format before writing your text:

\u001b[{format};{color}m
@ghostrider-05
ghostrider-05 / discord_app_protocols.md
Last active August 21, 2025 19:49
An unofficial list of discord app protocol routes

Discord app protocol routes

Home:

  • /: discord://-/
  • friends: discord://-/channels/@me/
  • nitro: discord://-/store
  • shop: discord://-/shop
  • message requests: discord://-/message-requests
  • family centre: discord://-/family-center
@Rychu-Pawel
Rychu-Pawel / TimeSpanExtensions.cs
Created April 29, 2021 08:37
TimeSpan Readable Ago String
public static class TimeSpanExtensions
{
// Inspired by @Peter answear from https://stackoverflow.com/questions/842057/how-do-i-convert-a-timespan-to-a-formatted-string
public static string ToReadableAgoString(this TimeSpan span, double justNowSecondsThreshold)
{
if (span.TotalSeconds < justNowSecondsThreshold)
return "just now";
return span switch
{
@loganpowell
loganpowell / graphql-args-passing.md
Last active December 25, 2024 23:14
GraphQL Passing Arguments (parent, args, context, info)
@donno
donno / fetch_vcdist.py
Last active July 3, 2025 11:03
Downloads and extract the Visual C++ Redistributables.
"""Downloads and extract the Visual C++ Redistributables.
This is useful when working with minidump files as the user may be running
with a new different version of the runtime. This script aims to maintain
a copy of the various versions.
Versions are normally added once I encounter them, in November 2022, I added
a rather large back catalogue of versions.
This requires dark.exe from Wix (http://wixtoolset.org/releases/) and
@shafik
shafik / WhatIsStrictAliasingAndWhyDoWeCare.md
Last active August 22, 2025 02:46
What is Strict Aliasing and Why do we Care?

What is the Strict Aliasing Rule and Why do we care?

(OR Type Punning, Undefined Behavior and Alignment, Oh My!)

What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.

In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.

Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th

@matthewzring
matthewzring / markdown-text-101.md
Last active August 23, 2025 01:46
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers: