Skip to content

Instantly share code, notes, and snippets.

View srndpty's full-sized avatar

Masaki Takano srndpty

View GitHub Profile
@srndpty
srndpty / zapall.cs
Last active October 28, 2021 12:23
Zap all files from all subdirectories recursively
using System.IO;
namespace ZapAll
{
class Program
{
private static readonly char separator = Path.DirectorySeparatorChar;
static void Main(string[] args)
{
@srndpty
srndpty / pixiv_link_sanitizer.js
Created February 5, 2021 20:17
get rid of unwanted jump.php thing at pixiv
// based on UI-Default.shader which is available on https://unity3d.com/get-unity/download/archive
Shader "Custom/RainbowGradient"
{
Properties
{
[HideInInspector] [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
[HideInInspector] _Color ("Tint", Color) = (1,1,1,1)
[HideInInspector] _StencilComp ("Stencil Comparison", Float) = 8
[HideInInspector] _Stencil ("Stencil ID", Float) = 0
[HideInInspector] _StencilOp ("Stencil Operation", Float) = 0
@srndpty
srndpty / AngleBetween.cpp
Last active February 19, 2018 15:14
Get angle between 2 objects ignoring Y axis
#include <cmath>
struct vec3
{
float x, y, z;
};
float length(vec3 v)
{
return sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
using UnityEngine;
using System.Collections;
public class MinMaxSliderAttribute : PropertyAttribute
{
public readonly float max;
public readonly float min;
public MinMaxSliderAttribute(float min, float max)
{
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.Linq;
[CanEditMultipleObjects]
[CustomEditor(typeof(Transform))]
public class TransformInspector : Editor
{
enum TargetType
@srndpty
srndpty / AdvCommandLayerOff.cs
Created June 22, 2016 07:00
レイヤーを指定して消去する拡張コマンド
/// <summary>
/// レイヤーを指定して消去するコマンド
/// </summary>
public class AdvCommandLayerOff : AdvCommand
{
string layerName;
float fadeTime;
float waitEndTime;
public AdvCommandLayerOff(StringGridRow row)
internal class AdvCommandCharacter2 : AdvCommandCharacter
{
public static List<string> concurrectLayers = new List<string>();
public static bool toBeCleared = false;
public AdvCommandCharacter2(StringGridRow row, AdvSettingDataManager dataManager)
: base(row, dataManager)
{
}
Shader "Custom/TestShading" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
}
SubShader {
Tags { "RenderType" = "Opaque" }
CGPROGRAM
#pragma surface surf Lambert
struct Input {
float4 color : COLOR;