Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Increasing revenue/reducing costs...

Simon Gilbert sahgilbert

💭
Increasing revenue/reducing costs...
View GitHub Profile
@sahgilbert
sahgilbert / UnifiedController.cs
Created Jun 3, 2019
C# ASP.Net Core - Unified MVC & Web Api Controller
View UnifiedController.cs
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace SimonGilbert.Blog.Controllers
{
public class UnifiedController : Controller
{
[HttpGet]
public IActionResult Index()
{
@sahgilbert
sahgilbert / DateTimeExtensions.cs
Created May 22, 2019
DateTime Extension Methods - C# .Net Core
View DateTimeExtensions.cs
using System;
namespace SimonGilbert.Blog
{
public static class DateTimeExtensions
{
public static string ToRelativeDate(this DateTime dateTime)
{
var timeSpan = DateTime.Now - dateTime;
@sahgilbert
sahgilbert / NumericalExtensions.cs
Created May 22, 2019
Numerical Extension Methods - C# .Net Core
View NumericalExtensions.cs
using System;
namespace SimonGilbert.Blog
{
public static class NumericalExtensions
{
public static double RoundByDecimalPlaces(this double number, int numberOfDecimalPlaces = 2)
{
return Math.Round(number, numberOfDecimalPlaces);
}
@miguelmota
miguelmota / process_names.txt
Last active Feb 21, 2021
macOS process whitelist
View process_names.txt
# not an exhaustive list
nsurlsessiond "icloud sync"
fseventsd "macos file system events"
WindowServer "macos windows"
DisplayLinkManager "macos driver"
configd "macos dynamic configuration"
displaypolicyd "macos process"
CommCenter "macos keychain"
kernel_task "macos kernel"