Skip to content

Instantly share code, notes, and snippets.

@mmozeiko
mmozeiko / !README.md
Last active June 14, 2025 13:18
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).

@FrancescoK
FrancescoK / codex-rails-8-setup.sh
Last active June 14, 2025 13:18
OpenAI codex environment setup script for Rails 8 with Playwright
#!/usr/bin/env bash
set -euo pipefail
apt-get update -qq
apt-get install -yqq libreadline-dev zlib1g-dev libyaml-dev libvips-dev libheif-dev libde265-dev xz-utils ca-certificates wget libpq-dev vim unzip gnupg2 dirmngr
# Uncomment if you run Postgres. Make sure to add postgres to apt-get install on line 5
# pg_ctlcluster --skip-systemctl-redirect 16 main start
# su - postgres -c "createuser -s $(whoami)"
@wojteklu
wojteklu / clean_code.md
Last active June 14, 2025 13:18
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@akoivist
akoivist / settime.py
Created September 1, 2024 13:15
Python app to set the time of a ATC/PVVX BLE thermometers
import asyncio
import time
import datetime
import pytz # Ensure you have pytz installed
from bleak import BleakScanner, BleakClient # Ensure you have bleak installed
from bleak.exc import BleakError
# Define the MAC address and characteristic UUID
DEVICE_ADDRESS = "xx:xx:xx:xx:xx:xx"
CHARACTERISTIC_UUID = "00001f1f-0000-1000-8000-00805f9b34fb"
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active June 14, 2025 13:10
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This does not works in browser for non-video, non-activity quests! For stream/play quests use the desktop app!

Note

When doing stream quests, you need at least 1 other account in the vc!

How to use this script:

  1. Accept a quest under Discover -> Quests
@realvjy
realvjy / ChoasLinesShader.metal
Last active June 14, 2025 13:09
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@Tan12d
Tan12d / Leetcode 2566 | Maximum Difference by Remapping a Digit.java
Created June 14, 2025 13:03
Leetcode 2566 | Maximum Difference by Remapping a Digit
class Solution {
public int minMaxDifference(int num)
{
char leftMostDigit = '0';
String number = Integer.toString(num);
for(int i=0;i<number.length();i++)
{
if(number.charAt(i)!='9')
@davialexandre
davialexandre / gruvbox_dark.json
Created June 23, 2019 18:09
Gruvbox Dark color scheme for the new Windows Terminal
{
"background" : "#282828",
"black" : "#282828",
"blue" : "#458588",
"brightBlack" : "#928374",
"brightBlue" : "#83A598",
"brightCyan" : "#8EC07C",
"brightGreen" : "#B8BB26",
"brightPurple" : "#D3869B",
"brightRed" : "#FB4934",
@sandhikagalih
sandhikagalih / script.js
Created June 13, 2024 15:05
Javascript Image Preview
const input = document.getElementById('avatar');
const previewPhoto = () => {
const file = input.files;
if (file) {
const fileReader = new FileReader();
const preview = document.getElementById('avatar-preview');
fileReader.onload = function(event) {
preview.setAttribute('src', event.target.result);
}
fileReader.readAsDataURL(file[0]);
@samhenrigold
samhenrigold / _WWDC25 AI-ML Group Lab.md
Last active June 14, 2025 12:57
WWDC25 Machine Learning and AI Frameworks group lab

(Summary generated by ChatGPT based on the automatic transcription. Transcript is attached to this Gist)

Panelists:

  • Host: Shashank

  • Panelists: Michael, Erik, Richard, Ronan