Skip to content

Instantly share code, notes, and snippets.

View richardneililagan's full-sized avatar
🚀

Richard Neil Ilagan richardneililagan

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

eks-ingress-test

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

Prerequisites

  • [eksctl][2]
@richardneililagan
richardneililagan / promisify-file-reader.js
Last active October 16, 2016 20:14
Promisify `FileReader`.
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 September 27, 2013 07:12
Poor man's IOC injector. Had to create a really quick injector for a quick story in a project. Worked like a charm.
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 March 3, 2016 07:49
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
namespace Mvc.Cors
{
using System.Linq;
using System.Web.Http.Filters;
public class CorsEnabledAttribute : ActionFilterAttribute
{
private string[] allowedDomains;
public CorsEnabledAttribute()
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;