Skip to content

Instantly share code, notes, and snippets.

@jrgcubano
jrgcubano / CircuitBreakerWithPolly.cs
Last active August 29, 2018 14:42
Retry and circuit breaker pattern in C# (services, httpclient, polly)
https://github.com/App-vNext/Polly/wiki/Circuit-Breaker
CircuitBreakerPolicy breaker = Policy
.Handle<HttpException>()
.CircuitBreaker(
exceptionsAllowedBeforeBreaking: 2,
durationOfBreak: TimeSpan.FromMinutes(1)
);
@nemotoo
nemotoo / .gitattributes
Last active May 17, 2024 03:14
.gitattributes for Unity3D with git-lfs
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
@lukas-h
lukas-h / license-badges.md
Last active May 14, 2024 18:38
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

@keijiro
keijiro / ToggleTest.shader
Last active March 24, 2023 00:43
Shows how to use the Toggle material property drawer in a shader. See the reference manual for further details: http://docs.unity3d.com/ScriptReference/MaterialPropertyDrawer.html
Shader "ToggleTest"
{
Properties
{
[Toggle(FILL_WITH_RED)]
_FillWithRed ("Fill With Red", Float) = 0
}
SubShader
{
Pass
@elringus
elringus / BlendModes.c
Last active March 11, 2024 11:32
Popular blend mode algorithms implemented in Nvidia's Cg. https://elringus.me/blend-modes-in-unity/
fixed3 Darken (fixed3 a, fixed3 b)
{
return min(a, b);
}
fixed3 Multiply (fixed3 a, fixed3 b)
{
return a * b;
}