Skip to content

Instantly share code, notes, and snippets.

View theoparis's full-sized avatar
🔥
Compiling LLVM with -fskibidi -Ohio -march=rizz

Theo Paris theoparis

🔥
Compiling LLVM with -fskibidi -Ohio -march=rizz
View GitHub Profile
@nir9
nir9 / server.c
Created December 20, 2023 18:38
Minimalist HTTPS Web Server in C - not for production use, only for fun :)
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <openssl/ssl.h>
#include <stdio.h>
#include <string.h>
void main() {
int sockfd = socket(AF_INET, SOCK_STREAM, 0);
@aamiaa
aamiaa / RevertNewLayout.md
Last active April 29, 2024 21:25
Revert New Discord Layout

The original snippet no longer works!

On 02/09/2024 at around 8pm UTC, Discord flipped an experiment (2023-09_mobile_redesign_override_toggles) which ignores the layout toggle that this script relied on.

If you want to continue using the old layout, you can either use a modded mobile client (such as Vendetta) to disable that experiment, or downgrade to an old version of the app.

Method 1 - Downgrading (Android)

Tip

Use this one if you want a fast, beginner-friendly solution and don't mind using a version from November 2023

  1. Download version 205.15 of Discord mobile app from ApkMirror
@Ce11an
Ce11an / surreal.py
Last active March 6, 2023 03:07
SurrealDB WebSocket Client
"""SurrealDB websocket client library."""
import enum
import json
from types import TracebackType
from typing import Any, Dict, List, Optional, Tuple, Type, Union
import pydantic
import websockets
@slimsag
slimsag / ramblings.md
Last active December 13, 2023 08:02
Because cross-compiling binaries for Windows is easier than building natively

Because cross-compiling binaries for Windows is easier than building natively

I want Microsoft to do better, want Windows to be a decent development platform-and yet, I constantly see Microsoft playing the open source game: advertising how open-source and developer friendly they are - only to crush developers under the heel of the corporate behemoth's boot.

The people who work at Microsoft are amazing, kind, talented individuals. This is aimed at the company's leadership, who I feel has on many occassions crushed myself and other developers under. It's a plea for help.

The source of truth for the 'open source' C#, C++, Rust, and other Windows SDKs is proprietary

You probably haven't heard of it before, but if you've ever used win32 API bindings in C#, C++, Rust, or other languages, odds are they were generated from a repository called microsoft/win32metadata.

@LiosK
LiosK / uuidv8_example.c
Last active April 3, 2024 02:11
UUIDv8 Example
#include <stdint.h>
#include <time.h>
int get_random_bytes(uint8_t *buffer, int count);
int generate_uuidv8(uint8_t *uuid, uint8_t node_id) {
struct timespec tp;
if (clock_gettime(CLOCK_REALTIME, &tp) != 0)
return -1; // real-time clock error
@mmozeiko
mmozeiko / !README.md
Last active May 5, 2024 00:02
Download MSVC compiler/linker & Windows SDK without installing full Visual Studio

This downloads standalone 64-bit MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for 64-bit native desktop app development.

Run python.exe portable-msvc.py and it will download output into msvc folder. By default it will download latest available MSVC & Windows SDK - currently v14.32.17.2 and v10.0.22621.0.

You can list available versions with python.exe portable-msvc.py --show-versions and then pass versions you want with --msvc-version and --sdk-version arguments.

To use cl.exe/link.exe from output folder, first run setup.bat - after that PATH/INCLUDE/LIB env variables will be setup to use all the tools as usual. You can also use clang-cl.exe with these includes & libraries.

To use clang-cl.exe without running setup.bat, pass extra /winsysroot msvc argument (msvc is folder name where output is stored).

@notheotherben
notheotherben / starship.toml
Created November 11, 2021 15:28
A Powerline configuration for Starship.rs
format = """
[\uE0B6](fg:#1C4961)[$directory](bg:#1C4961)[\uE0B0](fg:#1C4961 bg:#2F79A1)$git_branch[\uE0B0](fg:#2F79A1 bg:#3A95C7)$git_status[\uE0B0](#3A95C7 bg:#40A9E0)$time[\uE0B0](#40A9E0 bg:none) $all$character """
add_newline = true
[directory]
style = "bg:#1C4961 fg:white"
[git_branch]
format = "[ $symbol$branch ]($style)"
@pratyakshm
pratyakshm / windowsinstallusingdism.md
Last active April 15, 2024 15:27
Installing Windows 11 on any device using DISM

Install Windows 11 on unsupported devices

Guide to install Windows 11 on any PC (does not involve ISO modifications) This guide will take you through a clean and simple way to install Windows 11 on your device by bypassing all requirements without doing any ISO modifications. Note: Guide shows fresh installation only.

Requirements:

  1. ISO file (Link 1) (Link 2) (22000.65)
  2. Rufus Microsoft Store GitHub Website
  3. USB drive [8GB or more]
@rexim
rexim / 0001-Make-it-possible-to-include-files-over-https.patch
Last active April 13, 2024 15:16
TCC patch that enables including files via HTTPS using CURL
From 84c42091cbae3735c52e895221f3f95a87155756 Mon Sep 17 00:00:00 2001
From: rexim <reximkut@gmail.com>
Date: Wed, 30 Jun 2021 20:43:47 +0700
Subject: [PATCH] Make it possible to include files over https
---
Makefile | 2 +-
tcc.c | 5 +++++
tccpp.c | 43 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 49 insertions(+), 1 deletion(-)
@misterabdul
misterabdul / main.c
Created June 18, 2021 03:55
Simple OpenGL program to open window.
#include <stdio.h>
#include <stdlib.h>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
int
main()
{
// Initialise GLFW