Skip to content

Instantly share code, notes, and snippets.

View bin-zhao's full-sized avatar

William Benjamin bin-zhao

View GitHub Profile
@bin-zhao
bin-zhao / Distortion.shader
Created January 27, 2021 06:36 — forked from Fewes/Distortion.shader
Distortion shader for Unity. Supports a normal map.
Shader "Distortion"
{
Properties
{
_Refraction ("Refraction", Range (0.00, 10.0)) = 1.0
_Power ("Power", Range (1.00, 10.0)) = 1.0
_AlphaPower ("Vertex Alpha Power", Range (1.00, 10.0)) = 1.0
_BumpMap( "Normal Map", 2D ) = "bump" {}
_Cull ( "Face Culling", Int ) = 2
@bin-zhao
bin-zhao / UIDissolve.shader
Created January 26, 2021 07:11 — forked from benloong/UIDissolve.shader
Dissolve shader for Unity
Shader "UI/Dissolve"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
@bin-zhao
bin-zhao / htmlparser.js
Created April 24, 2017 12:48 — forked from cburgmer/htmlparser.js
John Resig's JavasScript HTML parser with bug fixes for parsing <script> & <style>
/*
* HTML Parser By John Resig (ejohn.org)
* Original code by Erik Arvidsson, Mozilla Public License
* http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
*
* // Use like so:
* HTMLParser(htmlString, {
* start: function(tag, attrs, unary) {},
* end: function(tag) {},
* chars: function(text) {},
/*
* Customized by Misato Takahashi <misato@takahashi.name>
* - fix if Html document has "<!DOCTYPE>" then parse error.
* - fix if Attribute name includes "-" then parse error
* - fix if Unmatch case start tag and end tag then parse error
* - add function "getElementById"
*
* HTML Parser By John Resig (ejohn.org)
* Original code by Erik Arvidsson, Mozilla Public License
* http://erik.eae.net/simplehtmlparser/simplehtmlparser.js