Skip to content

Instantly share code, notes, and snippets.

View baharclerode's full-sized avatar

Bryan Harclerode baharclerode

View GitHub Profile
@baharclerode
baharclerode / Memoizer.java
Last active August 19, 2018 18:46
Memoizer Helper Utility
/*
* Copyright 2018 Bryan Harclerode
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
@baharclerode
baharclerode / consul.lua
Created June 26, 2018 19:27 — forked from gmr/consul.lua
Dynamic Nginx upstream nodes using Consul
module("resty.consul", package.seeall)
_VERSION = '0.1.0'
function service_nodes(service)
local http = require "resty.http"
local json = require "cjson"
local hc = http:new()
local upstream = ""
@baharclerode
baharclerode / InjectableHealthCheck.java
Last active September 15, 2016 15:23
Making Dropwizard Components Injectable
package server;
import com.codahale.metrics.health.HealthCheck;
import org.glassfish.jersey.spi.Contract;
/**
* Interface to "add" the @Contract annotation to injectable components; This is necessary to stop Jersey complaining about unknown
* components being added to it.
*/
@Contract
import com.google.common.collect.ImmutableList;
import lombok.extern.slf4j.Slf4j;
import org.aopalliance.intercept.ConstructorInterceptor;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.glassfish.hk2.api.Descriptor;
import org.glassfish.hk2.api.Filter;
import org.glassfish.hk2.api.InterceptionService;
import org.glassfish.hk2.api.TypeLiteral;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶