Skip to content

Instantly share code, notes, and snippets.

@EDDxample
EDDxample / Lattice Basics.ipynb
Last active May 12, 2024 17:52
Lattice Basics for RNG Seed finding
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@notnotrobby
notnotrobby / cgp.md
Last active May 12, 2024 17:52
List of free resources to study computer graphics programming.
@blattmann
blattmann / Git: Empty branch.md
Last active May 12, 2024 17:52
Git: Create empty branch

Replace empty-branch with your desired branch name.

git checkout --orphan empty-branch

Then you can remove all the files you'll have in the staging area (so that they don't get committed):

git rm -rf .

At this point you have an empty branch, on your machine.

@danvy
danvy / WSL2-Net-Fix.ps1
Created September 5, 2020 21:04
Reset your WSL network connection trying to fix WSL2 media disconnected error
# Check these threads before proceeding:
# https://github.com/microsoft/WSL/discussions/5857
# https://github.com/microsoft/WSL/issues/5821
if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
$CmdLine = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments
Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CmdLine
Exit
}
# Restart the Host Network Service
Restart-Service -Force -Name hns
@cupracer
cupracer / varnishlog-examples.sh
Last active May 12, 2024 17:50
varnishlog examples (version 4.x)
# filter by request host header
varnishlog -q 'ReqHeader ~ "Host: example.com"'
# filter by request url
varnishlog -q 'ReqURL ~ "^/some/path/"'
# filter by client ip (behind reverse proxy)
varnishlog -q 'ReqHeader ~ "X-Real-IP: .*123.123.123.123"'
# filter by request host header and show request url and referrer header
@joaquinicolas
joaquinicolas / gist:b7d0a0869485bca5156d0d4be87820f4
Created December 15, 2021 02:59
Setup flutter environment in arch linux
pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
yay -S flutter
java -version
sudo pacman -S jre8-openjdk
#include <https://raw.githubusercontent.com/SanderMertens/flecs/master/flecs.h>
#include <https://raw.githubusercontent.com/SanderMertens/flecs/master/flecs.c>
#include <https://gist.githubusercontent.com/ArnCarveris/535cf7c25007271bfa75d6396853a4a3/raw/99b57783a906995b4b89c4fb8d053c0ed2981603/flecs_godbolt.h>
typedef struct {
float x, y;
} Position, Velocity;
typedef struct {
float time;

The Composable Architecture (可组装架构)

The Composable Architecture (简写为TCA) 让你用统一、便于理解的方式来搭建应用程序,它兼顾了组装,测试,以及功效。你可以在 SwiftUI,UIKit,以及其他框架,和任何苹果的平台(iOS、macOS、tvOS、和 watchOS)上使用 TCA。

@mhogg
mhogg / elementConnectivity.py
Created March 17, 2015 05:42
Getting ABAQUS element connectivities
from abaqus import *
from abaqusConstants import *
from odbAccess import *
odb = session.viewports[session.currentViewportName].displayedObject
instName = 'MALE'
elements = odb.rootAssembly.instances[instName].elements
foutName = 'elementConnectivity.txt'
@probonopd
probonopd / Wayland.md
Last active May 12, 2024 17:42
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

Wayland proponents make it seem like Wayland is "the successor" of Xorg, when in fact it is not. It is merely an incompatible alternative, and not even one that has (nor wants to have) feature parity (missing features). And unlike X11 (the X Window System), Wayland protocol designers actively avoid the concept of "windows" (making up incompr