Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀

Richard Neil Ilagan richardneililagan

🚀
View GitHub Profile
@richardneililagan
richardneililagan / README.md
Created Apr 2, 2020
Deploying an ALB Ingress Controller in Amazon EKS
View README.md

eks-ingress-test

This repo is a documentation of steps taken to create an ALB Ingress Controller on [Amazon EKS][1].

Prerequisites

  • [eksctl][2]
View promisify-file-reader.js
function promisifyFileReader (filereader) {
function composeAsync (key) {
return function () {
var args = arguments
return new Promise (function (resolve, reject) {
//
function resolveHandler () {
cleanHandlers()
resolve(filereader.result)
}
@richardneililagan
richardneililagan / BasicInjector.cs
Created Sep 27, 2013
Poor man's IOC injector. Had to create a really quick injector for a quick story in a project. Worked like a charm.
View BasicInjector.cs
class BasicInjector : IInjector
{
private Dictionary<Type, object> registry = new Dictionary<Type, object>();
public IInjector Register<TKey, TConcrete>()
where TConcrete : TKey
{
return Register<TKey>(() => Activator.CreateInstance<TConcrete>());
}
@richardneililagan
richardneililagan / CorsEnabledAttribute.cs
Last active Mar 3, 2016
A bunch of classes for enabling CORS support for MVC 4 Web API, based off of Carlos Figueira's work. https://gist.github.com/richardneililagan/5091035/#comment-791095
View CorsEnabledAttribute.cs
namespace Mvc.Cors
{
using System.Linq;
using System.Web.Http.Filters;
public class CorsEnabledAttribute : ActionFilterAttribute
{
private string[] allowedDomains;
public CorsEnabledAttribute()
View Global.asax.cs
public class MvcApplication : System.Web.HttpApplication
{
...
private void WSFederationAuthenticationModule_RedirectingToIdentityProvider(object sender, RedirectingToIdentityProviderEventArgs e)
{
// Get the request url.
var request = HttpContext.Current.Request;
var requestUrl = request.Url;