Skip to content

Instantly share code, notes, and snippets.

@stantoxt
stantoxt / WebGL-WebGPU-frameworks-libraries.md
Created March 4, 2025 09:07 — forked from dmnsgn/WebGL-WebGPU-frameworks-libraries.md
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub
@stantoxt
stantoxt / docker-registry-mirrors.md
Created December 6, 2024 09:09 — forked from y0ngb1n/docker-registry-mirrors.md
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@stantoxt
stantoxt / ShuffleArray.cs
Created June 25, 2024 09:16 — forked from cosmicmonster/ShuffleArray.cs
Unity / C# code to shuffle an array using the Fisher-Yates Shuffle.
using UnityEngine;
using System.Collections;
public class ShuffleArray : MonoBehaviour {
// Public so you can fill the array in the inspector
public int[] scenarios;
void Start ()
@stantoxt
stantoxt / fisher-yates.cs
Created June 25, 2024 09:14 — forked from mikedugan/fisher-yates.cs
a simple C# implementation of the fisher-yates shuffle used to randomize array elements without bias
public static void Shuffle<T>(T[] array)
{
var random = _random;
for (int i = array.Length; i > 1; i--)
{
// Pick random element to swap.
int j = random.Next(i); // 0 <= j <= i-1
// Swap.
T tmp = array[j];
array[j] = array[i - 1];
# Opens a PowerShell instance with elevation, finds the wsl ip without relying on hostname, since ArchWSL and others doesn't have it
# then iterate opening the selected ports
$principal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
if($principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
$remoteport = wsl -- ip -o -4 -json addr list eth0 ` | ConvertFrom-Json ` | %{ $_.addr_info.local } ` | ?{ $_ }
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if($found) {
$remoteport = $matches[0];
} else{
@stantoxt
stantoxt / Startup.cs
Created August 9, 2023 14:50 — forked from aqwert/Startup.cs
ASPNetCore Change response via Middleware
namespace Project
{
public class Startup
{
public Startup(IHostingEnvironment env)
{
//...
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
@stantoxt
stantoxt / installing_postgresql.md
Created June 5, 2023 10:57 — forked from 15Dkatz/installing_postgresql.md
PostgreSQL installation tutorial

Let's install PostgreSQL onto your operating system.

As an open source object-relational database management system, PostgreSQL available for MacOS, Linux, and Windows.

Goal for each Operating System

The goal will be to run the following command successfully from the command line (regardless of the OS):

psql -U postgres

This should open the psql interactive shell and print a prompt that looks like:

// open your terminal
1. Download source from official website
2. Extract it into some folder
3. Do this command
cd source_of_postgres_dir
./configure
make
su
make install
adduser postgres
@stantoxt
stantoxt / CustomerController.cs
Created May 20, 2022 14:02 — forked from vkhorikov/CustomerController.cs
Handling failures and input errors in a functional way
[HttpPost]
public HttpResponseMessage CreateCustomer(string name, string billingInfo)
{
Result<BillingInfo> billingInfoResult = BillingInfo.Create(billingInfo);
Result<CustomerName> customerNameResult = CustomerName.Create(name);
return Result.Combine(billingInfoResult, customerNameResult)
.OnSuccess(() => _paymentGateway.ChargeCommission(billingInfoResult.Value))
.OnSuccess(() => new Customer(customerNameResult.Value))
.OnSuccess(
@stantoxt
stantoxt / letsencrypt-acme-guide.md
Created April 25, 2022 05:31 — forked from ammgws/letsencrypt-acme-guide.md
Using acme.sh script to renew LetsEncrypt certs using non-standard SSL port

1. Install acme.sh shell script

git clone https://github.com/Neilpang/acme.sh.git
cd acme.sh
./acme.sh --install

Optionally, set the home dir and/or account info (if already have one).
If was previously using LetsEncrypt's certbot, can probably get account info from /etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/*/regr.json.