Skip to content

Instantly share code, notes, and snippets.

@keiranlovett
keiranlovett / beautiful.rest.api.docs.in.markdown.md
Created June 26, 2023 17:58 — forked from azagniotov/beautiful.rest.api.docs.in.markdown.md
Example to create beautiful REST API docs in Markdown, inspired by Swagger API docs.
@keiranlovett
keiranlovett / USDZ Sample 1
Created October 17, 2018 16:06 — forked from ksurendra/USDZ Sample 1
Universal Scene Description Zip - USDZ Sample Files
@keiranlovett
keiranlovett / Easing.cs
Created June 14, 2017 02:37 — forked from Fonserbc/Easing.cs
Compact and simple easing functions for Unity
using UnityEngine;
/*
* Functions taken from Tween.js - Licensed under the MIT license
* at https://github.com/sole/tween.js
*/
public class Easing
{
public static float Linear (float k) {
@keiranlovett
keiranlovett / git-feature-workflow.md
Created June 14, 2017 02:15 — forked from blackfalcon/git-feature-workflow.md
Git basics - a general workflow

There are many Git workflows out there, I heavily suggest also reading the atlassian.com [Git Workflow][article] article as there is more detail then presented here.

The two prevailing workflows are [Gitflow][gitflow] and [feature branches][feature]. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited.

When using Bash in the command line, it leaves a bit to be desired when it comes to awareness of state. I would suggest following these instructions on [setting up GIT Bash autocompletion][git-auto].

Basic branching

When working with a centralized workflow the concepts are simple, master represented the official history and is always deployable. With each now scope of work, aka feature, the developer is to create a new branch. For clarity, make sure to use descriptive names like transaction-fail-message or github-oauth for your branches.

@keiranlovett
keiranlovett / TriggerVolume.cs
Created January 19, 2016 08:24 — forked from brunomikoski/TriggerVolume.cs
General trigger for detecting collisions
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[RequireComponent(typeof(Collider))]
/// <summary>
/// General purpose trigger volume system
///
/// </summary>
/// <author>Bruno Mikoski</author>
/// <summary>
/// Returns a position on the edge of the screen
/// </summary>
/// <param name="horizontal">0 being left, and 1 being right</param>
/// <param name="vertical">0 being botton, and 1 being top of the screen</param>
/// <param name="horizontalPadding">Padding from the screen, 0 means on screen, and 0.1 will be 10% off the screen</param>
/// <param name="verticalPadding"> </param>
/// <returns></returns>
public Vector3 GetOffScreenPosition(float horizontal,
float vertical,
@keiranlovett
keiranlovett / DiffuseOverlay.shader
Created January 19, 2016 08:21 — forked from brunomikoski/DiffuseOverlay.shader
Overlay difuse shader (Object Above Everything else)
Shader "Custom/DiffuseOverlay" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
// Tags {"RenderType"="Opaque"} // original
Tags {"Queue" = "Overlay" "RenderType"="Opaque"} // modified
ZTest Always // this line is added
LOD 200
@keiranlovett
keiranlovett / StopPlayingOnRecompile.cs
Created January 19, 2016 08:05 — forked from zapdot/StopPlayingOnRecompile.cs
Stop Playing on Recompile
using UnityEditor;
[InitializeOnLoad]
public class StopPlayingOnRecompile
{
static StopPlayingOnRecompile()
{
EditorApplication.update = () =>
{
if (EditorApplication.isCompiling && EditorApplication.isPlaying)
@keiranlovett
keiranlovett / ExportPBRTextures.jsx
Last active August 29, 2015 14:27 — forked from GetUpKidAK/ExportTextures.jsx
Photoshop script to export textures from layered PSD
// Enables exporting of several PBR maps from a single PSD with a few clicks:
// 1. Select an export folder (default to PSD path on Windows)
// 2. Choose which PSD layer group corresponds to which map (split into separate RGB/Alpha channels)
// 3. Change the file export options (if required)
// 4. Hit export.
#target photoshop
app.bringToFront();
// DEFAULT EXPORT OPTIONS
Shader "Custom/Skybox RGBM HDR Linear" {
Properties {
_Cubemap ("Cubemap", Cube) = "white" {}
_Exposure ("Exposure", Float) = 20.0
}
SubShader {
Tags { "Queue"="Background" "RenderType"="Background" }
Cull Off
ZWrite Off