Skip to content

Instantly share code, notes, and snippets.

@malcohelper
malcohelper / README.md
Last active June 13, 2025 08:20
setup_env_react_native

Setup Environment React Native by ONE Script

setup_env

FlowChart Untitled diagram-2025-02-21-063607

This script automates the installation and setup of the essential development environment on macOS, including:

  • Homebrew
  • RVM (Ruby Version Manager) and Ruby
  • NVM (Node Version Manager) and Node.js
@hirbod
hirbod / fix-react-native-rcthost-not-found.md
Last active June 13, 2025 08:19
React Native fix for libraries failing with ReactCommon/RCTHost.h not found - CNG - Config Plugin - Podfile fix

What

If you’re using Zeego or any other React Native library that throws weird framework-related errors like “ReactCommon/RCTHost.h not found”, this is for you. The issue started with RN 0.78+ and usually only affects the old architecture with useFrameworks: 'static'.

Versions before 0.78, setups without useFrameworks, or users on the new architecture are not affected, thus do not need this workaround.

Fix for Expo users

I’ve prepared a config plugin for you. Create a file, e.g. plugins/with-runtime-framework-headers.js, with the following contents:

const { withPodfile } = require('expo/config-plugins')
@Thundernerd
Thundernerd / Docker.cs
Last active June 13, 2025 08:18
Helper to dock EditorWindows
#if UNITY_EDITOR
using System;
using System.Reflection;
using UnityEditor;
using UnityEngine;
public static class Docker
{
#region Reflection Types
@Rich-Harris
Rich-Harris / footgun.md
Last active June 13, 2025 08:17
Top-level `await` is a footgun

Edit — February 2019

This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:

  • TC39 is currently moving forward with a slightly different version of TLA, referred to as 'variant B', in which a module with TLA doesn't block sibling execution. This vastly reduces the danger of parallelizable work happening in serial and thereby delaying startup, which was the concern that motivated me to write this gist
  • In the wild, we're seeing (async main(){...}()) as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problems
  • Therefore, a version of TLA that solves the original issue is a valuable addition to the language, and I'm in full support of the current proposal, which you can read here.

I'll leave the rest of this document unedited, for archaeological

@mypy-play
mypy-play / main.py
Created June 13, 2025 07:17
Shared via mypy Playground
from collections.abc import Callable
def typed[**P, T](f: Callable[P, T]) -> Callable[P, T]:
return f
def untyped(f):
return f
def foo(a: int, b: str) -> bool:
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active June 13, 2025 08:12
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@pcgeek86
pcgeek86 / cheatsheet.ps1
Last active June 13, 2025 08:11
PowerShell Cheat Sheet / Quick Reference
Get-Command # Retrieves a list of all the commands available to PowerShell
# (native binaries in $env:PATH + cmdlets / functions from PowerShell modules)
Get-Command -Module Microsoft* # Retrieves a list of all the PowerShell commands exported from modules named Microsoft*
Get-Command -Name *item # Retrieves a list of all commands (native binaries + PowerShell commands) ending in "item"
Get-Help # Get all help topics
Get-Help -Name about_Variables # Get help for a specific about_* topic (aka. man page)
Get-Help -Name Get-Command # Get help for a specific PowerShell function
Get-Help -Name Get-Command -Parameter Module # Get help for a specific parameter on a specific command
@lzlrd
lzlrd / wslg-guide.md
Last active June 13, 2025 08:11
How to get WSLg working with OpenGL, Vulkan, and CUDA on (Official) Arch Linux and Ubuntu WSL Instances.

WSLg with OpenGL, Vulkan, and CUDA on (Official) Arch Linux and Ubuntu WSL Instances

Note: I haven't documented CUDA here. I'm lazy (and haven't tested on Arch). See https://documentation.ubuntu.com/wsl/en/latest/howto/gpu-cuda for that on Ubuntu.

Context

microsoft/wslg#1312:

So I got this working on both Ubuntu, and Arch. First, start with a fresh install (of archlinux from https://gitlab.archlinux.org/archlinux/archlinux-wsl or Ubuntu from wsl --install Ubuntu or https://apps.microsoft.com/detail/9pdxgncfsczv).

Arch

@mathershifter
mathershifter / docker_wsl2_containerlab.md
Last active June 13, 2025 08:06
Docker + WSL2 + Containerlab

Docker + WSL2 + Containerlab

Hyper-V

  • Open a PowerShell prompt as Administrator

  • Enable Hyper-V

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All