Skip to content

Instantly share code, notes, and snippets.

@manzt
manzt / my-ts-monorepo.md
Last active March 15, 2025 22:36
A minimal setup for TypeScript monorepo libraries

My Minimal TypeScript Monorepo Setup for ESM Libraries

After a deep dive looking up best practices for TypeScript monorepos recently, I couldn't find anything that suited my needs:

  1. Publish individual (typed) packages to NPM with minimal config.
  2. Supports fast unit testing that spans the entire project (e.g., via Vitest)
  3. Ability to have an interactive playground to experiment with the API in a real-time (e.g., via Vite)

Most solutions point to TypeScript project references,

@Jomy10
Jomy10 / rust_in_swift.md
Last active March 15, 2025 22:34
Calling Rust library from Swift code (creating executable)

Calling a Rust library from Swift

This gist shows a quick overview of calling Rust in a Swift project, with Swift Package Manager configured.

Let's go ahead and create a folder containing all our sources:

mkdir swift-rs && cd $_
@netdisciple
netdisciple / pf.conf
Last active March 15, 2025 22:34
OpenBSD pf upnp setup for multiplayer gaming
#be sure to pin your console with a dhcp reservation, then put that IP address below in the staticports table
#define a table
table <staticports> { 192.168.1.188 }
#at the top of the configuration, add the match statement with the static-port keyword right after scrub
set block-policy drop
set loginterface egress
set skip on lo0
match in all scrub (no-df random-id max-mss 1440)
@mda590
mda590 / stress_test.py
Created June 8, 2018 14:07
Python script useful for stress testing systems
"""
Produces load on all available CPU cores.
Requires system environment var STRESS_MINS to be set.
"""
from multiprocessing import Pool
from multiprocessing import cpu_count
import time
import os
@markknol
markknol / shadertoy.md
Last active March 15, 2025 22:33
Shader cheatsheet (from shadertoy)

This help only covers the parts of GLSL ES that are relevant for Shadertoy. For the complete specification please have a look at GLSL ES specification

Language:

Version: WebGL 2.0
Arithmetic: ( ) + - ! * / %
Logical/Relatonal: ~ < > <= >= == != && ||
Bit Operators: & ^ | << >>
Comments: // /* */
Types: void bool int uint float vec2 vec3 vec4 bvec2 bvec3 bvec4 ivec2 ivec3 ivec4 uvec2 uvec3 uvec4 mat2 mat3 mat4 mat?x? sampler2D, sampler3D samplerCube
Format: float a = 1.0; int b = 1; uint i = 1U; int i = 0x1;

@shivampip
shivampip / mongodb_pass_reset.md
Created November 6, 2019 16:31
MongoDB shell admin password reset
  • open mongod.conf
cd /etc/mongod.conf
  • Comment security
#security:
#  authroization: "enabled"
@Ruhrozz
Ruhrozz / universal_ssh_guide.md
Last active March 15, 2025 22:28
Universal guide for SSH users

Подготовка к работе

Заходим в терминал и вводим

ssh-keygen
# можно повыбирать ключ
# ssh-keygen -t rsa -b 2048 -C "yc_key"
# ssh-keygen -t ed25519-sk -f ~/.ssh/rsa/id_ed25519_sk

State of Async WASI in Rust

Let me share what I've learned about implementing async WASIp2 components in Rust. My goal is to get the entire Tokio ecosystem working together seamlessly. This isn't a complete test of the ecosystem - some things might be simpler than we expect. Check out dicej's wasi-socket-tests repository for examples.

The first obstacle: you'll need a nightly version of Rust. Without it, you'll need major ecosystem changes to avoid the wasip2 module in the Rust standard library and use wasi crates for the necessary functionality.

Let's walk through the steps to get Reqwest working with Tokio.

Socket2

@nemotoo
nemotoo / .gitattributes
Last active March 15, 2025 22:24
.gitattributes for Unity3D with git-lfs
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf