Skip to content

Instantly share code, notes, and snippets.

View ncthbrt's full-sized avatar
🧶
Coding

Natalie Cuthbert ncthbrt

🧶
Coding
View GitHub Profile
@felixhaeberle
felixhaeberle / timeAgo.ts
Last active May 10, 2024 13:43
TypeScript: Get time distance as human readable string
// takes either a unix time number, string or a Date object and returns time string
export const timeAgo = (time: number | string | Date) => {
switch (typeof time) {
case "number":
break;
case "string":
time = +new Date(time);
break;
case "object":
// Apply this to a Camera, and make a material with the shader.
public class CameraRenderWithMaterial : MonoBehaviour
{
public Material material;
void OnRenderImage(RenderTexture source, RenderTexture destination)
{
Graphics.Blit(source, destination, material);
}
}
@ammarshah
ammarshah / all_email_provider_domains.txt
Last active June 19, 2024 14:13
A list of all email provider domains (free, paid, blacklist etc). Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
0-mail.com
007addict.com
020.co.uk
027168.com
0815.ru
0815.su
0clickemail.com
0sg.net
0wnd.net
0wnd.org
@EddieCameron
EddieCameron / EdgeDetect.cs
Created September 3, 2017 00:08
EdgeDetection in new Unity Postprocessing Stack
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
[Serializable]
[PostProcess( typeof( EdgeDetectRenderer ), PostProcessEvent.BeforeStack, "Custom/EdgeDetectNormals" )]
public sealed class EdgeDetect : PostProcessEffectSettings {
public enum EdgeDetectMode {
@benloong
benloong / UIDissolve.shader
Last active April 17, 2024 20:30 — forked from nukeop/dissolve.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
@xanathar
xanathar / Easing.cs
Created March 17, 2016 23:54
Robert Penner's easing equations for Unity
/**
* Easing
* Animates the value of a float property between two target values using
* Robert Penner's easing equations for interpolation over a specified Duration.
*
* Original Author: Darren David darren-code@lookorfeel.com
*
* Ported to be easily used in Unity by Marco Mastropaolo
*
* Credit/Thanks:
@ruby0x1
ruby0x1 / tilt.shift.glsl
Last active February 19, 2024 02:46
Tilt shift shader, modified from something @grapefrukt gave me
// Modified version of a tilt shift shader from Martin Jonasson (http://grapefrukt.com/)
// Read http://notes.underscorediscovery.com/ for context on shaders and this file
// License : MIT
uniform sampler2D tex0;
varying vec2 tcoord;
varying vec4 color;
/*
Take note that blurring in a single pass (the two for loops below) is more expensive than separating