Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Ody Mbegbu odytrice

🏠
Working from home
Block or report user

Report or block odytrice

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View fsharp-tutorial.fs
// This sample will guide you through elements of the F# language.
//
// *******************************************************************************************************
// To execute the code in F# Interactive, highlight a section of code and press Alt-Enter in Windows or
// Ctrl-Enter Mac, or right-click and select "Send Selection to F# Interactive".
// You can open the F# Interactive Window from the "View" menu.
// *******************************************************************************************************
// For more about F#, see:
@odytrice
odytrice / sicp.fs
Last active Oct 29, 2019
Structure and Interpretation of Computer Programs - F# Code Examples
View sicp.fs
(* SICP Chapter #01 Examples in F# *)
#light
(* 1.1.1 The Elements of Programming - Expressions *)
486
137 + 349
1000 - 334
5 * 99
10 / 5
2.7 + 10.0
@odytrice
odytrice / Extensions.cs
Last active Sep 28, 2019
Generic Abstract Model
View Extensions.cs
public static class Extensions
{
public static T ParseEnum<T>(this string value) where T : struct
{
if (Enum.TryParse(value, true, out T enumobj))
{
return enumobj;
}
else
{
@odytrice
odytrice / ExcelProcessor.cs
Last active Sep 28, 2019
Excel Processor using EPPlus Nuget Package
View ExcelProcessor.cs
public class ExcelProcessor
{
public Stream Generate<T>(Dictionary<string, IEnumerable<T>> Sheets)
{
//Generate Excel Workbook in Memory
using (var excel = new ExcelPackage())
{
if (Sheets.Any() == false) throw new Exception("No Sheets were supplied");
foreach (var pair in Sheets)
@odytrice
odytrice / ImageService.cs
Last active Sep 28, 2019
Image Processor
View ImageService.cs
public class ImageService : IImageService
{
#region Scale Stream
public Stream ScaleWidth(Stream imageStream, int maxWidth)
{
var output = new MemoryStream();
//Get Image from Stream
using (var image = Image.FromStream(imageStream))
{
@odytrice
odytrice / windows-terminal-profile.json
Created Sep 28, 2019
Ody's Windows Terminal Profile
View windows-terminal-profile.json
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"globals" :
{
"alwaysShowTabs" : true,
"copyOnSelect" : false,
"defaultProfile" : "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"initialCols" : 120,
"initialRows" : 30,
"keybindings" :
View self-signed-certificate-with-custom-ca.md

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@odytrice
odytrice / Ninject.Http.cs
Last active Jul 25, 2019
A small Library to configure Ninject (A Dependency Injection Library) with a WebAPI Application.
View Ninject.Http.cs
using Ninject.Modules;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.Http;
using System.Web.Http.Dependencies;
// A small Library to configure Ninject (A Dependency Injection Library) with a WebAPI Application.
@odytrice
odytrice / Ninject.Mvc.cs
Last active Jun 14, 2019
A small Library to configure Ninject (A Dependency Injection Library) with an ASP.NET Application.
View Ninject.Mvc.cs
using Ninject;
using Ninject.Modules;
using Ninject.Web.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.Mvc;
@odytrice
odytrice / README.md
Created Jun 2, 2019
Kubectx, Kubens for Windows (Powershell)
View README.md
You can’t perform that action at this time.