Skip to content

Instantly share code, notes, and snippets.

View houkanshan's full-sized avatar
👾
My game is Mai and I like making names

Mai Hou houkanshan

👾
My game is Mai and I like making names
View GitHub Profile
@pesterhazy
pesterhazy / indexeddb-problems.md
Last active May 27, 2024 07:40
The pain and anguish of using IndexedDB: problems, bugs and oddities

This gist lists challenges you run into when building offline-first applications based on IndexedDB, including open-source libraries like Firebase, pouchdb and AWS amplify (more).

Note that some of the following issues affect only Safari. Out of the major browsers, Chrome's IndexedDB implementation is the best.

Backing file on disk (WAL file) keeps growing (Safari)

When this bug occurs, every time you use the indexeddb, the WAL file grows. Garbage collection doesn't seem to be working, so after a while, you end up with gigabytes of data.

Random exceptions when working with a large number of indexeddb databases (Safari)

@dpid
dpid / how-to-notarize-unity-for-macos.md
Last active December 6, 2023 20:42
How to notarize a Unity build for MacOs 10.15 Catalina

How to notarize a Unity build for macOs 10.15 Catalina

As of January 2020, all apps running on macOs 10.15 Catalina are required to be notarized. For Unity games distributed outside the Mac App Store, such as with Steam, the notarization process is done post build using a series of Xcode command line tools.

Prerequisites

  • a Mac that is compatible with macOs 10.15 Catalina :
    • MacBook (2015 or newer)
    • MacBook Air (2012 or newer)
  • MacBook Pro (2012 or newer)

Fixing macOS 10.14, 10.15, 12

Dark main menu without the rest of dark mode

  1. Set Light mode
  2. defaults write -g NSRequiresAquaSystemAppearance -bool Yes
  3. Log out and log back in
  4. Set Dark mode
@radiatoryang
radiatoryang / VertexLit-Retro3D.shader
Created May 13, 2018 18:56
yet another retro3D shader for Unity with lower vertex precision / etc... made of parts from https://github.com/dsoft20/psx_retroshader and https://github.com/keijiro/Retro3D
// mostly from https://github.com/dsoft20/psx_retroshader
// mixed with parts of https://github.com/keijiro/Retro3D
// under MIT license by Robert Yang (https://debacle.us)
Shader "Custom/VertexLit-Retro3D" {
Properties{
_MainTex("Base (RGB)", 2D) = "white" {}
_Color("Color", Color) = (0.5, 0.5, 0.5, 1)
_GeoRes("Geometric Resolution", Float) = 40
}
@Split82
Split82 / UnityShadersCheatSheet.shader
Created April 17, 2018 10:07
Unity Shaders Cheat Sheet
Shader "Name" {
Properties {
_Name ("display name", Range (min, max)) = number
_Name ("display name", Float) = number
_Name ("display name", Int) = number
_Name ("display name", Color) = (number,number,number,number)
_Name ("display name", Vector) = (number,number,number,number)
@keijiro
keijiro / 00_FlipCheck.shader.md
Last active July 5, 2018 11:02
A Unity shader that detects flipped polygons.

screenshot

@ppolsinelli
ppolsinelli / GoogleSheetDownload.cs
Last active April 5, 2023 09:11
Getting Google Sheet Data Updates In Unity
YOUR METHOD HERE - BEGIN
if (SOME_CONTROL_OF_YOURS && Application.isEditor)
{
Action<string> commCallback = (csv) =>
{
LoadCSVText(csv);
};
StartCoroutine(DownloadCSVCoroutine(spreadSheetId, commCallback, true, "YOUR_ASSET_NAME_NO_EXT", tabId));
@Draknek
Draknek / zip-app.py
Last active March 27, 2024 15:21
Normally if you zip a .app directory on Windows and unzip it on Mac OS X, it won't run. This tool creates a zip file that should have the correct executable flags set to work correctly.
#!/usr/bin/env python3
import os
import sys
import time
import zipfile
startingdir = os.getcwd()
if (len(sys.argv) == 1):
print("Usage: " + os.path.basename(sys.argv[0]) + " path/to/application.app [path/to/output.zip]")
@smkplus
smkplus / UnityShaderCheatSheet.md
Last active May 7, 2024 07:34
Controlling fixed function states from materials/scripts in Unity

16999105_467532653370479_4085466863356780898_n

Shader "MaterialPropertyDrawer"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
 
[HideInInspector] _MainTex2("Hide Texture", 2D) = "white" {}
@yumayanagisawa
yumayanagisawa / First.compute
Last active November 20, 2021 23:33
Unity | Compute Shader Particle System
#pragma kernel CSParticle
// Particle's data
struct Particle
{
float3 position;
float3 velocity;
float life;
};