Skip to content

Instantly share code, notes, and snippets.

View theoparis's full-sized avatar

Theo Paris theoparis

View GitHub Profile
@mmozeiko
mmozeiko / !README.md
Last active April 18, 2025 02:13
Download MSVC compiler/linker & Windows SDK without installing full Visual Studio

This downloads standalone 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 native desktop app development.

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

You can list available versions with py.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 first run setup_TARGET.bat - after that PATH/INCLUDE/LIB env variables will be updated 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).

@lalunamel
lalunamel / gist:716de8bb16cbf1d942324fc2120931ee
Last active October 22, 2024 02:01
Understanding how XCode builds (llbuild)

Understanding how XCode builds

Raw notes are at the top

Human-readable blog post is in the middle

Raw Notes:

llbuild is the build system used by xcode and the swift package manager.

@Alee14
Alee14 / arch-0.1.md
Last active November 24, 2024 11:41
Installing Arch Linux 0.1 with X11
@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 8, 2025 01:13
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 September 22, 2024 12:24
TCC patch that enables including files via HTTPS using CURL
From 84c42091cbae3735c52e895221f3f95a87155756 Mon Sep 17 00:00:00 2001
From: rexim <[email protected]>
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
@inscapist
inscapist / flake-direnv.md
Last active August 9, 2024 17:24
Nix Flakes and Direnv on Mac OSX (Catalina)

Development environment with Nix Flakes and Direnv

This document is targeted at those who seek to build reproducible dev environment across machines, OS, and time.

It maybe easier for remote teams to work together and not spending hours each person setting up asdf/pyenv/rbenv, LSP servers, linters, runtime/libs. Nix is probably the closest thing to Docker in terms of development environment.

Flake is used here because it provides hermetic build, with absolutely no reliance on system environment (be it Arch/Catalina/Mojave). Also it freezes dependencies in flake.lock so builds are reproducible.

This gist provides the setup to develop Java/Clojure/Python applications on Nix. But it can be easily adapted to ruby, nodejs, haskell.

@zchee
zchee / nvram.c
Last active April 9, 2025 21:19
nvram list from xnu-8020.101.4 (`rg PE_parse_boot_ --sort=path --line-number --no-multiline --no-heading`)
bsd/crypto/entropy/entropy_sysctl.c:134: if (__improbable(PE_parse_boot_argn(ENTROPY_ANALYSIS_BOOTARG, &sample_count, sizeof(sample_count)))) {
bsd/dev/dtrace/dtrace.c:19237: if (!PE_parse_boot_argn("dtrace_kernel_symbol_mode", &dtrace_kernel_symbol_mode, sizeof (dtrace_kernel_symbol_mode))) {
bsd/dev/dtrace/dtrace.c:19348: if (!PE_parse_boot_argn("dtrace_dof_mode", &dtrace_dof_mode, sizeof (dtrace_dof_mode))) {
bsd/dev/dtrace/dtrace.c:19412: PE_parse_boot_argn("keepsyms", &keepsyms, sizeof(keepsyms));
bsd/dev/dtrace/fbt_blacklist.c:395: PE_parse_boot_argn("IgnoreFBTBlacklist", &ignore_fbt_blacklist, sizeof(ignore_fbt_blacklist));
bsd/dev/mem.c:89:#include <pexpert/pexpert.h> /* for PE_parse_boot_argn */
bsd/dev/mem.c:272: PE_parse_boot_argn("kmem", &kmem, sizeof(kmem))) {
bsd/dev/unix_startup.c:286: (void) PE_parse_boot_argn("ncl", &ncl, sizeof(ncl));
bsd/dev/unix_startup.c:287: (void) PE_parse_boot_argn("mbuf_pool", &mbuf_pool, sizeof(mbuf_pool));
bsd/kern/bsd_init.c:442: if (PE_parse_boot_argn("rd"
@nickdesaulniers
nickdesaulniers / build.sh
Last active August 21, 2024 18:45
linking hello world against musl built as LTO
# Building musl
$ ./configure CC=clang LD=lld
$ make -j72
# Building with musl (non-lto, no patch)
$ clang hello.c -nostdlib -fuse-ld=lld -L lib -lc -static lib/crt1.o
# Building against musl LTO
$ clang hello.c -nostdlib -fuse-ld=lld -static lib/crt1.o -Wl,--whole-archive lib/libc.a -Wl,--no-whole-archive -Wl,--gc-sections