Skip to content

Instantly share code, notes, and snippets.

View BenTristem's full-sized avatar
🏠
Working from home

Ben Tristem BenTristem

🏠
Working from home
View GitHub Profile
@BenTristem
BenTristem / Engineering Room Principles.md
Last active September 13, 2022 07:47
Engineering Room Principles

Top 10 Guidelines

  1. Paste a link to live notes at top of room.
  2. Only moderate as many as needed (max 3).
  3. Challenge arguments, don't attack people.
  4. Consider "yes and", rather than "no but".
  5. Interrupt sparingly, only if needed.
  6. Give priority to the softest voices.
  7. Use GIFs and reactions liberally.
  8. Please leave your ego at the door.
  9. Back claims with quality links in chat.
@BenTristem
BenTristem / rename.py
Created May 18, 2019 12:30
Renames files from annoying date format to sane
import os
from time import strptime
dir_path = os.path.dirname(os.path.realpath(__file__))
file_list = os.listdir(dir_path)
def rename(file):
month_name = file.split('-')[0]
month_num = str(strptime(month_name, '%b').tm_mon).zfill(2)
@BenTristem
BenTristem / UnityMonobehaviourHeader
Created July 10, 2018 19:13
A way of structuring the top of your Unity Engine MonoBehaviour classes
// configuration PARAMETERS, consider ScriptableObject
    
// private instance variables for STATE
// cached REFERENCES for readability
// messages, then public METHODS, then private methods...
@BenTristem
BenTristem / TowerFactory.cs
Last active March 15, 2018 17:00
A circular or ring buffer system for placing RTS towers. Part of https://www.udemy.com/unitycourse2
public class TowerFactory : MonoBehaviour {
[SerializeField] Tower towerPrefab;
[SerializeField] int towerLimit = 5;
Queue<Tower> towerQueue = new Queue<Tower>();
public void AddTower(Waypoint waypoint)
{
Vector3 newPos = waypoint.transform.position;
@BenTristem
BenTristem / AudioTrigger.cs
Created April 23, 2017 16:41
Simple audio trigger with layer filter.
using UnityEngine;
public class AudioTrigger : MonoBehaviour
{
[SerializeField] AudioClip clip;
[SerializeField] int layerFilter = 0;
[SerializeField] float triggerRadius = 5f;
[SerializeField] bool isOneTimeOnly = true;
[SerializeField] bool hasPlayed = false;
@BenTristem
BenTristem / gist:651c726c43c199a694a9
Created July 14, 2015 18:13
Unity .gitignore file
# =============== #
# Unity generated #
# =============== #
Temp/
Obj/
UnityGenerated/
Library/
Assets/AssetStoreTools*
# ===================================== #
[Test]
public void Dondi10thFrameTurkey () {
int[] rolls = {1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1};
foreach (int roll in rolls) {
actionMaster.Bowl (roll);
}
Assert.AreEqual (reset, actionMaster.Bowl (10));
Assert.AreEqual (reset, actionMaster.Bowl (10));
Assert.AreEqual (endGame, actionMaster.Bowl (10));
}