Skip to content

Instantly share code, notes, and snippets.

@mob-sakai
mob-sakai / _README.md
Last active February 20, 2024 00:29
Run shell script on gist

Run shell script on gist

Shells that support process substitution such as bash and zsh allow to run shell script on gist as follows.

# With curl:
bash <(curl -sL ${GIST_URL}) args...

# With wget:
@mob-sakai
mob-sakai / RemoveEmptyFolders.cs
Last active September 22, 2023 18:33
Automatically remove empty folders in project for Unity.
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Linq;
using System;
/// <summary>
/// Remove empty folders automatically.

Unity CLI Tools (macOS)

Installation

curl -sL https://gist.githubusercontent.com/mob-sakai/c6e1a5362bc6237cfc9caafaf02e1de4/raw/unity.sh >> ~/.zprofile

Usage

@mob-sakai
mob-sakai / CacheableDownloadHandler.cs
Created July 28, 2017 10:04
Etag-cacheable DownloadHandler for Unity.
using UnityEngine.Networking;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using UnityEngine;
using System;
namespace Mobcast.Coffee.AssetSystem
{
@mob-sakai
mob-sakai / ComponentConverter.cs
Created November 29, 2017 02:19
Component converter for Unity
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
/// <summary>
/// Component converter for editor.
/// </summary>
public static class ComponentConverter
{
//%%%% v Context menu for editor v %%%%
@mob-sakai
mob-sakai / .releaserc.json
Last active December 23, 2020 08:14
semantic-release-upm
{
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"master",
"main",
{
"name": "preview",
"prerelease": true
}
],
#!/bin/bash -ex
while getopts "e" OPT
do
case $OPT in
e) EDITOR_ONLY="true";;
\?) echo "[ERROR] Undefined options.";;
esac
done
Shader "Unlit/VectorGradient (SoftMaskable)"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
[HideInInspector] _RendererColor ("RendererColor", Color) = (1,1,1,1)
// vvvv ADD FOR SOFTMASKABLE vvvv
_StencilComp ("Stencil Comparison", Float) = 8
@mob-sakai
mob-sakai / unity_release.sh
Last active February 15, 2019 12:31
UnityアセットをGithubへリリースするスクリプト(UPM対応版)。要github_changelog_generator&gh-release。実行するにはコメント参照
#!/bin/bash -e
# NOTE: Run the following command at the prompt
# bash <(curl -sL 'https://gist.github.com/mob-sakai/e281baa04e1a47148b62387f9c7967df/raw/unity_release.sh')
# NOTE: Set an environment variable `CHANGELOG_GITHUB_TOKEN` by running the following command at the prompt, or by adding it to your shell profile (e.g., ~/.bash_profile or ~/.zshrc):
# export CHANGELOG_GITHUB_TOKEN="«your-40-digit-github-token»"
# 1. << Input release version >>
@mob-sakai
mob-sakai / ReactiveCollectionExtensionsEx.cs
Created August 1, 2017 01:46
ReactiveCollection拡張メソッド.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UniRx;
using System.Linq;
using System;
/// <summary>
/// ReactiveCollection拡張メソッド.
/// </summary>