Skip to content

Instantly share code, notes, and snippets.

View demonixis's full-sized avatar

Yannick Comte demonixis

View GitHub Profile
@maluoi
maluoi / SKRecenter.cs
Last active September 14, 2023 07:22
StereoKit "Reset to center"
using StereoKit;
SK.Initialize("SKRecenter");
SK.Run(() => {
Mesh.Sphere.Draw(Material.Default, Matrix.TS(0, 0, -0.5f, 0.1f));
if (Input.Key(Key.Space).IsJustActive()) {
// Get the head pose, and flatten the rotation to just the Y axis.
Pose head = Input.Head;
head.orientation.x = 0;
@phi-lira
phi-lira / UnlitTexture.shader
Last active March 23, 2024 18:12
URP Unlit Texture example
Shader "Custom/UnlitTexture"
{
Properties
{
[MainColor] _BaseColor("BaseColor", Color) = (1,1,1,1)
[MainTexture] _BaseMap("BaseMap", 2D) = "white" {}
}
// Universal Render Pipeline subshader. If URP is installed this will be used.
SubShader
@tdbe
tdbe / BakeryLightmapManager.cs
Last active August 27, 2022 19:00
A lightmap manager for the Bakery lightmapper from the unity asset store. You can now swap between multiple versions of your lightmaps, and combine different bakes from different lightmap groups.
/// <summary>
/// Author: tudor, https://github.com/tdbe
/// You found this gist at: https://gist.github.com/tdbe/e3c41e6a2dedd88dad907218126a2c39
///
/// This is free and unencumbered software released into the public domain.
//
// Anyone is free to copy, modify, publish, use, compile, sell, or
// distribute this software, either in source code form or as a compiled
// binary, for any purpose, commercial or non-commercial, and by any
// means.
@munificent
munificent / generate.c
Last active March 18, 2024 08:31
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@denisgolius
denisgolius / generate-ssh-key.sh
Created October 4, 2018 06:55 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@msklywenn
msklywenn / BatchBuilderSettings.cs
Last active May 18, 2022 14:32
Unity Batch Builder
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
// Version 2, December 2004
//
// Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
//
// Everyone is permitted to copy and distribute verbatim or modified
// copies of this license document, and changing it is allowed as long
// as the name is changed.
//
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@wavezhang
wavezhang / java_download.sh
Last active April 26, 2024 10:36
download java from oracle without login
wget -c --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz
// Unity C# Cheat Sheet
// I made these examples for students with prior exerience working with C# and Unity.
// Too much? Try Unity's very good tutorials to get up to speed: https://unity3d.com/learn/tutorials/topics/scripting
@phosphoer
phosphoer / SimpleGeo.cs
Last active March 28, 2024 22:24
Simple Geometry Painter for Unity
// The MIT License (MIT)
// Copyright (c) 2016 David Evans @phosphoer
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
@rpavlik
rpavlik / GetRenderManager.cmd
Last active February 23, 2022 11:53
Batch script for keeping an up-to-date local copy of the latest 32 and 64-bit continuous builds of OSVR RenderManager and OSVR Core
@echo off
rem By Ryan Pavlik, Sensics, Inc. <http://sensics.com/osvr>
rem Copyright 2015-2016 Sensics, Inc.
rem SPDX-License-Identifier: Apache-2.0
rem Put this in a directory of its own, preferably. It will create one file and two subdirectories.
rem Doesn't hurt to run it more often than there are builds: it won't re-download (though
rem it will harmlessly re-extract)
rem Requires that you have wget and 7za (the command line version of 7z) in your path.