Skip to content

Instantly share code, notes, and snippets.

View NukeBird's full-sized avatar
Life is noise

NukeBird

Life is noise
View GitHub Profile
@hotohoto
hotohoto / rotate_yaw_pitch_roll.py
Last active July 1, 2024 15:38
Rotate an object by setting yaw pitch roll
import bpy
import mathutils
import math
# blender rotate in the right hand direction
figher = bpy.context.scene.objects['airplane']
figher.location = (0, 0, 0)
figher.rotation_euler = (0, 0, 0)
@raydouglass
raydouglass / nvidia-tdp.service
Created May 24, 2023 20:07 — forked from DavidAce/nvidia-tdp.service
Nvidia power limit at boot
[Unit]
Description=Set NVIDIA power limit above default
[Service]
Type=oneshot
ExecStartPre=/usr/bin/nvidia-smi -pm 1
ExecStart=/usr/bin/nvidia-smi -pl 275
@4wk-
4wk- / README.md
Last active September 20, 2024 16:53
Clean uninstall then reinstall of WSL on Windows 10, with systemD support

Uninstall then reinstall WSL on Windows 10 (clean way)

Background

I've been using wsl (version 2) with genie mod for years without issue, but one day, Windows 10 finally catch up on wsl Windows 11 features and gives us a way to use systemD natively.

I wanted to use the new "right way" to enable systemD on Windows Subsystem for Linux (without genie), and I also had a (probably related) infinite Windows RemoteApp error poping in.

Fixing it

A - Uninstall wsl and related stuff

  1. In powershell (as admin)
@p3jitnath
p3jitnath / install-docker.sh
Last active June 22, 2024 11:56
Docker and Nvidia Docker installation in Ubuntu 20.04 LTS
# WARNING : This gist in the current form is a collection of command examples. Please exercise caution where mentioned.
# Docker
sudo apt-get update
sudo apt-get remove docker docker-engine docker.io
sudo apt install docker.io
sudo systemctl start docker
sudo systemctl enable docker
docker --version
@pghazanfari
pghazanfari / camera.py
Created August 29, 2019 22:46
numpy Perspective Projection + Look At Matrices
import numpy as np
def perspective_fov(fov, aspect_ratio, near_plane, far_plane):
num = 1.0 / np.tan(fov / 2.0)
num9 = num / aspect_ratio
return np.array([
[num9, 0.0, 0.0, 0.0],
[0.0, num, 0.0, 0.0],
[0.0, 0.0, far_plane / (near_plane - far_plane), -1.0],
[0.0, 0.0, (near_plane * far_plane) / (near_plane - far_plane), 0.0]
@edwintcloud
edwintcloud / circular_buffer.cpp
Created May 7, 2019 18:40
Circular Buffer in C++
//===================================================================
// File: circular_buffer.cpp
//
// Desc: A Circular Buffer implementation in C++.
//
// Copyright © 2019 Edwin Cloud. All rights reserved.
//
//===================================================================
//-------------------------------------------------------------------
@SrPhilippe
SrPhilippe / vrchat-dynamic-bone-config.md
Last active May 31, 2024 12:01
Nice configs for dynamic bone to use on VRChat

Vrchat dynamic bone configs

Hair

Normal Long Hair Other
name value name value name value
damping 0.2 damping 0.894 damping 0.025
elasticity 0.05 elasticity 0.1 elasticity 0.008
stiffness 0.8 stiffness 0.783 stiffness 0.85
@w-flo
w-flo / test-ssbo-std430.cpp
Last active February 13, 2021 18:10
Test program for structured access to shader storage buffers
/*******
Compilation:
g++ test-ssbo-std430.cpp $(pkg-config --cflags --libs sdl2 glew) && MESA_DEBUG=true ./a.out
renderdoc 0.91 (e.g. git de7a74c7) can be configured to queue capture of frame 2 to inspect the results of this test program.
This is a simple test program to isolate one of the issues I encountered using my HD 7870 GPU and the Mesa radeonsi driver (amdgpu kernel module) while testing the Banshee 3D engine.
Mesa version is 17.2.4-0ubuntu1~17.10.1 (from Ubuntu artful-proposed archive).
@podgorskiy
podgorskiy / FrustumCull.h
Created July 12, 2017 10:33
Ready to use frustum culling code. Depends only on GLM. The input is only bounding box and ProjectionView matrix. Based on Inigo Quilez's code.
#include <glm/matrix.hpp>
class Frustum
{
public:
Frustum() {}
// m = ProjectionMatrix * ViewMatrix
Frustum(glm::mat4 m);
@bgromov
bgromov / git-reset-author.sh
Created June 23, 2016 17:50
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD