Skip to content

Instantly share code, notes, and snippets.

View douglasg14b's full-sized avatar
🎮
Gamedevving

Douglas Gaskell douglasg14b

🎮
Gamedevving
  • Oregon
View GitHub Profile
@regisdiogo
regisdiogo / Startup.cs
Last active June 13, 2022 11:17
ASP.NET Core - Json serializer settings Enum as string and ignore null values
public class Startup
{
public IServiceProvider ConfigureServices(IServiceCollection services)
{
services.AddMvc().AddJsonOptions(options =>
{
options.SerializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter());
options.SerializerSettings.NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore;
});
}
@janmisek
janmisek / gist:63bd49106e27eea771f4
Created May 21, 2015 08:02
Search for value in object
var walked = [];
var searchHaystack = function(haystack, needle, path, exactEquals) {
//dumb truthiness handling
exactEquals = exactEquals ? true : false;
if(typeof haystack != "object") {
console.warn("non-object haystack at " + path.join("."));
return [false, null];
///
/// Simple pooling for Unity.
/// Author: Martin "quill18" Glaude (quill18@quill18.com)
/// Latest Version: https://gist.github.com/quill18/5a7cfffae68892621267
/// License: CC0 (http://creativecommons.org/publicdomain/zero/1.0/)
/// UPDATES:
/// 2015-04-16: Changed Pool to use a Stack generic.
///
/// Usage:
///
@stramit
stramit / Text.cs
Created September 22, 2014 12:55
Text Element
using System;
using System.Collections.Generic;
using System.Text;
namespace UnityEngine.UI
{
/// <summary>
/// Labels are graphics that display text.
/// </summary>