Skip to content

Instantly share code, notes, and snippets.

View Adjuvant's full-sized avatar

Adjuvant

View GitHub Profile
@Adjuvant
Adjuvant / PrivateRepoClone.md
Last active May 21, 2021 11:20
Cloning private repo using git bash

If I was cloning a public repository I might use:

git clone https://github.com/strafe/project.git

but if the repository was private then I’d use:

git clone https://strafe:mygithubpassword@github.com/strafe/project.git

Please note if you use 2FA to secure your GitHub account then you’ll need to use a personal access token instead of your password.

@Adjuvant
Adjuvant / .gitattributes
Created March 1, 2021 18:01
Default Unity LFS list
# Image formats:
*.tga filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.tif filter=lfs diff=lfs merge=lfs -text
*.tiff filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.jpeg filter=lfs diff=lfs merge=lfs -text
*.gif filter=lfs diff=lfs merge=lfs -text
*.psd filter=lfs diff=lfs merge=lfs -text
@Adjuvant
Adjuvant / Note.cs
Created January 14, 2021 14:12
Simple editor text note.
using UnityEngine;
namespace Utilities
{
public class Note : MonoBehaviour
{
[TextArea]
[Tooltip("Doesn't do anything. Just comments shown in inspector")]
public string Notes = "This component shouldn't be removed, it does important stuff.";
}
/*
Copyright (c) 2018 Pete Michaud, github.com/PeteMichaud
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@Adjuvant
Adjuvant / convtran.sty
Last active October 17, 2019 20:32
Conversation transcript style. Extension of Gareth Walker's convtran latex style that works inside minipages and figures. First pass, total hack. Original http://gareth-walker.staff.shef.ac.uk/
%% convtran.sty
%% Copyright 2016 Gareth Walker
%% Minipage updates by Thomas Deacon, 2019
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
@Adjuvant
Adjuvant / DrawStringGizmo.cs
Created September 3, 2019 18:28
Method to put text in the Unity editor window
public static class Drawing
{
public static void DrawString(string text, Vector3 worldPos, Color? textColor = null, Color? backColor = null)
{
UnityEditor.Handles.BeginGUI();
var restoreTextColor = GUI.color;
var restoreBackColor = GUI.backgroundColor;
GUI.color = textColor ?? Color.white;
GUI.backgroundColor = backColor ?? Color.black;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using VRTK;
using UnityEngine.XR;
using Oculus.Avatar;
using Photon.Pun;
public class AvatarCustomDriverOpenVR : OvrAvatarDriver
@Adjuvant
Adjuvant / Pair.cs
Created April 21, 2019 14:17
Generic Containers
/// <summary>
/// Pair class. Stores two objects together.
/// </summary>
/// <typeparam name="T">First objects type.</typeparam>
/// <typeparam name="U">Second objects type.</typeparam>
public class Pair<T, U>
{
public Pair(){}
public Pair(T first, U second)
{
@Adjuvant
Adjuvant / LimitVelocity.cs
Created April 21, 2019 14:13
Stop objects freaking out, update heavy though.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LimitVelocity : MonoBehaviour
{
[SerializeField]
protected float limit = Mathf.Infinity;
@Adjuvant
Adjuvant / VectorSwizzles.cs
Created April 21, 2019 14:10
Vector Swizzle Extensions
/*
* Vector Swizzle Extensions by Tyler Glaiel
* Version 1.0
* Sample Usage:
Vector2 a = new Vector2(1, 2);
Vector4 b = a.yxxy();
Debug.Log(b); //outputs (2.0, 1.0, 1.0, 2.0)
*/
using UnityEngine;