Skip to content

Instantly share code, notes, and snippets.

View momo-the-monster's full-sized avatar

Momo the Monster momo-the-monster

View GitHub Profile
@robinsound
robinsound / SimpleGemInstaller.nsi
Last active November 3, 2021 01:00
NSIS script for Ruby, Git and DevKit installers. Then install a gem
!include LogicLib.nsh ;IF ELSE
!include "StrContains.nsh"
AutoCloseWindow true
OutFile "SimpleGemInstaller.exe"
;here you can reference to any other ruby version and set you prefer path
;you can use !define for compile time substitution
@nothke
nothke / PitchShift.cs
Last active December 18, 2022 01:40
Unity C# Keyboard keys to pitch of a sound conversion
///
/// Changes pitch of any audio clip to match a pressed key on a (piano) keyboard
/// if a sound is in C4 (440hz) then it will perfectly match the scale
/// by Nothke
///
/// QWERTY.. row for white keys
/// 12345... row for black keys
/// press C to toggle chord mode in game
/// press N or M for minor or major
/// press A to toggle arpeggiate
@paraself
paraself / EditorPlayMode
Last active October 30, 2023 14:38
Unity Play Mode Detection
//originally adopted from
//http://answers.unity3d.com/questions/447701/event-for-unity-editor-pause-and-playstop-events.html
//with a few modifications which makes the event firing nicer and cleaner
//Usage Example :
//
//using UnityEditor;
//using UnityEngine;
//
//[InitializeOnLoad]
//public class SingleEntryPoint
@define-private-public
define-private-public / HttpServer.cs
Last active October 5, 2024 22:40
A Simple HTTP server in C#
// Filename: HttpServer.cs
// Author: Benjamin N. Summerton <define-private-public>
// License: Unlicense (http://unlicense.org/)
using System;
using System.IO;
using System.Text;
using System.Net;
using System.Threading.Tasks;
@SKempin
SKempin / Git Subtree basics.md
Last active September 22, 2024 13:17
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@seanh
seanh / html_tags_you_can_use_on_github.md
Last active October 6, 2024 06:58
HTML Tags You Can Use on GitHub

HTML Tags You Can Use on GitHub

Wherever HTML is rendered on GitHub (gists, README files in repos, comments on issues and pull requests, ...) you can use any of the HTML elements that GitHub Flavored Markdown (GFM) provides syntactic sugar for. You can either use the syntactic sugar that GFM (or other GitHub-supported markup language you're using) provides or, since Markdown can contain raw HTML, you can enter the HTML tags manually.

But GitHub also allows you to use a few HTML elements beyond what Markdown provides by entering the tags manually, and some of them are styled with CSS. Most raw HTML tags get stripped before rendering the HTML. Those tags that can be generated by GFM syntactic sugar, plus a few more, are whitelisted. These aren't documented anywhere that I can find. Here's what I've discovered so far:

<details> and <summary>

A `<detai

@naelstrof
naelstrof / VRChatHelper.cs
Last active January 3, 2023 21:03
Tests your avatar in-editor from the VRChat SDK->Test Selected Avatars menu item.
// VRChatHelper.cs, a tool to help test your model without launching VRChat.
// Made by naelstrof (naelstrof@gmail.com)
// Some eye tracking advice to help prevent this tool from yelling at you: https://docs.google.com/document/d/1BvX_OdEilbJ7wEcvd5MRA1g29NGCAp3G3nHGp73t_CQ/edit?usp=sharing
#if UNITY_EDITOR
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<RootNamespace></RootNamespace>
<IsPackable>False</IsPackable>
<NoWarn>CS0649;CS0169</NoWarn>
@heaversm
heaversm / skyboxstereo.shader
Created September 5, 2018 16:24
Unity Skybox Stereo Shader
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
Shader "Skybox/CubemapStereo" {
Properties {
_Tint ("Tint Color", Color) = (.5, .5, .5, .5)
[Gamma] _Exposure ("Exposure", Range(0, 8)) = 1.0
_Rotation ("Rotation", Range(0, 360)) = 0
[NoScaleOffset] _TexLeft ("Cubemap (HDR)", Cube) = "grey" {}
[NoScaleOffset] _TexRight ("Cubemap (HDR)", Cube) = "grey" {}
}
//based on https://github.com/Brackeys/Portal-In-Unity/blob/master/Portal/Assets/ScreenCutoutShader.shader
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "Unlit/BasicScreenCutoutShader"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
_EyeDistance("Eye Distance", Float) = 0
}