Skip to content

Instantly share code, notes, and snippets.

View keijiro's full-sized avatar

Keijiro Takahashi keijiro

View GitHub Profile
@keijiro
keijiro / kitty.conf
Created March 17, 2024 03:12
My Kitty configuration
# vim:fileencoding=utf-8:foldmethod=marker
#: Fonts {{{
#: kitty has very powerful font management. You can configure
#: individual font faces and even specify special fonts for particular
#: characters.
font_family Lilex Nerd Font Mono
# bold_font auto
@keijiro
keijiro / AngleAxis3x3.hlsl
Last active March 16, 2024 04:16
3x3 Rotation matrix with an angle and an arbitrary vector
// Rotation with angle (in radians) and axis
float3x3 AngleAxis3x3(float angle, float3 axis)
{
float c, s;
sincos(angle, s, c);
float t = 1 - c;
float x = axis.x;
float y = axis.y;
float z = axis.z;
@keijiro
keijiro / borg-with-gs.md
Last active February 5, 2024 01:58
Using Borg and Google Cloud Storage for backing up personal projects

Why do you prefer [Borg] over [git-lfs]/[git-annex]?

  • GitHub LFS has a 2GB limit on file size. This never works with large projects like video productions.
  • git-annex uses symlinks to manage annexed files. This doesn't work well on Windows.

So my conclusion at the moment is that Borg is the best backup software for mid/large-sized personal projects.

@keijiro
keijiro / install-ndi.sh
Last active January 27, 2024 09:25
Install the NDI shared library into a Linux system
#!/bin/sh
DEST=/usr/local/lib/x86_64-linux-gnu
test -d $DEST || mkdir $DEST
cp -P lib/x86_64-linux-gnu/libndi.so* $DEST
ldconfig
@keijiro
keijiro / setup_scoped_registry.md
Last active January 10, 2024 12:52
How to add "Keijiro" scoped registry to your Unity project

How to add "Keijiro" scoped registry to your Unity project

Open the Package Manager page in the Project Settings window and add the following entry to the "Scoped Registries" list:

  • Name: Keijiro
  • URL: https://registry.npmjs.com
  • Scope: jp.keijiro

Scoped Registry

@keijiro
keijiro / UnlitTransparentColored.shader
Created January 26, 2012 04:47
Unlit Transparent Colored Shader
Shader "Unlit/Transparent Colored" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
}
SubShader {
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
ZWrite Off
@keijiro
keijiro / transfer.sh
Created December 24, 2015 10:36
Transferring a repository from GitHub to BitBucket.
git clone --mirror https://github.com/keijiro/Foobar.git
git remote set-url --push origin https://keijiro@bitbucket.org/keijiro/Foobar
git push --mirror
@keijiro
keijiro / Random.hlsl
Last active November 12, 2023 00:08
Pseudo random number generator in HLSL using a hash function from H. Schechter & R. Bridson
// Hash function from H. Schechter & R. Bridson, goo.gl/RXiKaH
uint Hash(uint s)
{
s ^= 2747636419u;
s *= 2654435769u;
s ^= s >> 16;
s *= 2654435769u;
s ^= s >> 16;
s *= 2654435769u;
return s;
@keijiro
keijiro / prng.cginc
Last active October 17, 2023 20:36
One liner pseudo random generator with HLSL
float nrand(float2 uv)
{
return frac(sin(dot(uv, float2(12.9898, 78.233))) * 43758.5453);
}
@keijiro
keijiro / mesh_to_pointcloud.md
Last active October 9, 2023 12:34
How to convert a mesh into a point cloud with Houdini.

screenshot

  1. Import the source geometry.
  2. Append a Point Wrangle SOP and set the following snippet.
int vlist[] = pointvertices(0, @ptnum);
vector uv = vertex(0, "uv", vlist[0]);
@Cd = colormap("$HIP/TEXTURE_FILENAME.jpg", uv);
  1. Insert a Delete SOP. Change the pattern to "*". Enable "Keep Points".