Skip to content

Instantly share code, notes, and snippets.

@grofit
grofit / traefik-compose.yml
Created May 23, 2020
Setting up Traefik 2 dashboard with basic auth, this is the same as my basic traefik 2 setup but with user auth from a file, you can see the original one here https://gist.github.com/grofit/e9a94ca02ba31ed1db9f88104f81c502
View traefik-compose.yml
version: "3.7"
services:
traefik:
image: "traefik:v2.2"
container_name: "traefik"
ports:
- "80:80"
- "443:443"
- "8080:8080"
@grofit
grofit / traefik-compose.yml
Last active Jun 2, 2020
Setting up traefik 2 dashboard manually - This was a huge time sink for me, I hope this helps you (see https://gist.github.com/grofit/34c68dfa836eb351815edede5fc71f2f for my one with basic auth)
View traefik-compose.yml
version: "3.7"
services:
traefik:
image: "traefik:v2.2"
container_name: "traefik"
ports:
- "80:80"
- "443:443"
- "8080:8080" # could be any port you want 1234:8080
@grofit
grofit / EntityBatchOperation.cs
Created Apr 24, 2020
Entity Operation Batching
View EntityBatchOperation.cs
public class EntityBatchOperation
{
private const int NoComponentTypeId = -1;
private Entity _entity;
private List<int> _componentsAdded = new List<int>();
private List<int> _componentsRemoved = new List<int>();
public EntityBatchOperation(Entity entity)
{
@grofit
grofit / validate-property-attribute.js
Created Aug 4, 2016
CommonJS test for validation group failure
View validate-property-attribute.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ValidateProperty = undefined;
var _dec, _dec2, _class;
var _aureliaFramework = require("aurelia-framework");
@grofit
grofit / app.html
Created Apr 8, 2016 — forked from jdanyow/app.html
Aurelia Gist
View app.html
<template>
<h1>${message}</h1>
</template>
@grofit
grofit / NoCompositionOrSeparationItem.cs
Last active May 17, 2020
Example of view separation with composition
View NoCompositionOrSeparationItem.cs
public class NoCompositionOrSeparationItem
{
public Sprite ItemImage;
public Vector3 InventoryPosition;
public Image ItemOverlay;
public string Name {get;set;}
public ItemType Type {get;set;}
public int Value {get;set;}
}
@grofit
grofit / SceneExtensions.cs
Created Oct 1, 2015
uFrame MVVM View Instantiation Helpers
View SceneExtensions.cs
public static class SceneExtensions
{
public static TView InstantiatePrefabView<TView>(this IScene scene, ViewModel viewModel, string prefabName, string instanceName = null, Transform parent = null)
where TView : ViewBase, new()
{
var prefab = Resources.Load(prefabName) as GameObject;
if (prefab == null)
{ throw new Exception(string.Format("Cannot locate prefab [{0}]", prefabName)); }
var createViewCommand = new InstantiateViewCommand
{
@grofit
grofit / Objective.cs
Last active Dec 4, 2019
Quick RPG Quest System Example
View Objective.cs
public class Objective
{
public ObjectiveType Type {get;set;}
public int ObjectiveInt {get;set;}
public float ObjectiveFloat {get;set;}
public Vector3 ObjectiveVector {get;set;}
// could possibly use Dictionary instead
}
@grofit
grofit / ExistingApproach.cs
Created Jun 12, 2015
A hybrid Strategy/Chain Of Responsibility style approach
View ExistingApproach.cs
public class Character
{
public EntityStates CurrentState { get; }
public void Update()
{
switch(CurrentState)
{
case EntityStates.Idle
{
@grofit
grofit / AttackAction.cs
Last active Apr 22, 2016
Example of interacting with uFrame from NodeCanvas
View AttackAction.cs
using System.Collections;
using System.Collections.Generic;
using NodeCanvas;
using NodeCanvas.Variables;
using UnityEngine;
/*
Let us assume you have a uFrame Entity which can attack
and when it does it needs to play an animation in the view layer
and also needs to tell the controller to trigger an attack
You can’t perform that action at this time.