Skip to content

Instantly share code, notes, and snippets.

View ku6ryo's full-sized avatar
🏠
Working from home

Ryo Kuroyanagi ku6ryo

🏠
Working from home
View GitHub Profile
@ku6ryo
ku6ryo / lottery.gs
Last active April 15, 2024 14:57
Lottery script for Google App Script
/**
* Lottery. Returns a won prize ID
* Expected sheet structure. Please do not add header in the sheet.
* | ID of prize | name of prize | num of stock |
*
* Example (https://docs.google.com/spreadsheets/d/1Z_G_VducsGqGtpLtzfEEaTE-7RSydmBgbOrGRUyt8uE/edit?usp=sharing)
* | 1 | T shirt | 10 |
* | 2 | Notepad | 5 |
* | 4 | Sticker | 30 |
*/
@ku6ryo
ku6ryo / SimpleChromaKey.shader
Last active August 20, 2022 16:50
Simple chroma key Shader
Shader "ku6ryo/ChromaKey"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_KeyColor("Key Color", Color) = (1, 1, 1, 1)
_Acceptance("Acceptance", Range(0, 2)) = 1
}
SubShader
{
@ku6ryo
ku6ryo / ImageMagickCropSample.md
Last active April 11, 2022 14:04
ImageMagick center cropping
magick convert original/*.jpg -thumbnail 500x500^ -gravity center -extent 500x500 square/i.jpg

The output will be i-0.jpg, i-1.jpg ...

@ku6ryo
ku6ryo / WebCamFitToScreen.cs
Created November 17, 2021 11:58
Unity WebCam fitting to screen
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Controller : MonoBehaviour
{
WebCamTexture webcamTexture;
[SerializeField]
@ku6ryo
ku6ryo / Voronoi3dWorldPos.shader
Last active November 10, 2021 10:15
Voronoi3dWorldPos.shader
// This shader is written by refering the below articles.
// Expanded the 2D voronoi example shader to 3D use case.
// The base of the distance calculation is world position.
// So the voronoi pattern moves is an object moves.
// https://www.ronja-tutorials.com/post/028-voronoi-noise/
// https://www.ronja-tutorials.com/post/024-white-noise/
Shader "ku6ryo/Voronoi3dWorldPos" {
Properties {
@ku6ryo
ku6ryo / PeriodicEmission.shader
Created November 10, 2021 09:38
PeriodicEmission.shader
Shader "ku6ryo/PeriodicEmission"
{
// Slow blinking (depending on the time passed) emission effect shader made based on the Standard shader.
Properties
{
_Color ("Color", Color) = (1,0,0,1)
_Emission("Emission", Color) = (1,1,0,1)
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
}
@ku6ryo
ku6ryo / UnlitWireframe.shader
Last active November 10, 2021 10:08
UnlitWireframe Shader for Unity
Shader "ku6ryo/UnlitWireframe"
{
Properties
{
_Color ("Color", Color) = (1, 1, 1, 1)
_WireWidth ("Wire Width", Range(0, 1)) = 0.05
_Period ("Period", Range(0, 10)) = 1
}
SubShader
{
@ku6ryo
ku6ryo / LitTransparent.shader
Created November 1, 2021 10:24
Lit Transparent Shader (Checked on windows / Android / iOS)
Shader "ku6ryo/LitTransparent"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
}
SubShader
@ku6ryo
ku6ryo / UnlitTransparent.shader
Last active November 1, 2021 10:25
Unity Unlit Transparent Shader (Checked on windows / Android / iOS)
Shader "ku6ryo/UnlitTransparent"
{
Properties
{
_Color ("Color", Color) = (1, 1, 1, 1)
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Transparent" "Queue"="Transparent" }