Skip to content

Instantly share code, notes, and snippets.

View ginomessmer's full-sized avatar
🍍

Gino Messmer ginomessmer

🍍
View GitHub Profile
@ginomessmer
ginomessmer / BridgeCommand.cs
Last active March 3, 2016 21:36
Simple implementation of ICommand, usable in ViewModels as Commands
using System;
using System.Windows.Input;
// TODO: Namespace
/// <summary>
/// Simple implementation of ICommand, usable in ViewModels as Commands.
/// Acts like a common RelayCommand.
/// Example written in C# 6.
/// </summary>
@ginomessmer
ginomessmer / ObjectFileResourceController.cs
Created September 12, 2015 13:49
Deserializes/serializes objects to output files as JSON. Built on top of C# 6, requires Json.NET
using Newtonsoft.Json;
using System.IO;
using System.Text;
// TODO: Namespace
/// <summary>
/// De- or serializes objects to output files as JSON.
/// </summary>
/// <typeparam name="T">Object type to save or load</typeparam>
@ginomessmer
ginomessmer / ViewModelBase.cs
Last active December 21, 2017 13:21
Base class for ViewModels, implements OnPropertyChanged. Nothing further to do.
using System.ComponentModel;
using System.Runtime.CompilerServices;
// TODO: Namespace
/// <summary>
/// Base class for ViewModels, implements OnPropertyChanged. Nothing further to do.
/// </summary>
public partial class ViewModelBase : INotifyPropertyChanged
{
@ginomessmer
ginomessmer / TimeCycle.cs
Last active March 13, 2023 17:51
Extended Day/Night Cycle for Unity 5
using System;
using UnityEngine;
[RequireComponent(typeof(Light))]
public class TimeCycle : MonoBehaviour
{
public float CurrentTimeOfDay = 0;
public DayTime CurrentDayTime;
public float Hour = 0;
@ginomessmer
ginomessmer / CarController.cs
Created October 22, 2016 11:41
Player car controller for Unity3d supporting multiple axles.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class CarController : MonoBehaviour
{
public List<AxleInfo> AxleInfos;
public float MaxMotorTorque;
public float MaxSteeringAngle;
@ginomessmer
ginomessmer / DelegateCommand.cs
Created December 7, 2016 17:28
DelegateCommand for MVVM
public class DelegateCommand<T> : ICommand where T : class
{
private readonly Predicate<T> _canExecute;
private readonly Action<T> _execute;
public DelegateCommand(Action<T> execute)
: this(execute, null)
{
}
@ginomessmer
ginomessmer / HierarchyHelper.cs
Last active November 25, 2020 14:50
Neat Unity3D editor script for grouping objects in hierarchy
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
// Neat editor script for grouping objects in hierarchy by /u/SocialOfficer
//
public class HierarchyHelper
{
public static string Suffix = "_Root";
@ginomessmer
ginomessmer / official_rsg_crews.json
Last active February 22, 2017 20:05
Official three tags Rockstar Games SC crews
{
"crews": [
"IGN",
"MP3",
"LSB",
"ZBC",
"RDR",
"TMC",
"MHE",
"LAN",
@ginomessmer
ginomessmer / HttpAlive.cs
Last active June 27, 2017 09:17
HTTP Alive - Checks whether a website is up and running or nuked
using System;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using static System.Console;
namespace HttpAlive
{
class Program
{
@ginomessmer
ginomessmer / redirect-https.web.config
Created December 5, 2017 19:58
Redirect HTTP to HTTPS on IIS
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP/S to HTTPS Redirect" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{SERVER_PORT_SECURE}" pattern="^0$" />
</conditions>