Skip to content

Instantly share code, notes, and snippets.

View benjchristensen's full-sized avatar

Ben Christensen benjchristensen

View GitHub Profile
@benjchristensen
benjchristensen / index.html
Created August 9, 2011 05:38
Simple Sparkline using SVG Path and d3.js
<html>
<head>
<title>Simple Sparkline using SVG Path and d3.js</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style>
/* tell the SVG path to be a thin blue line without any area fill */
path {
stroke: steelblue;
stroke-width: 1;
fill: none;
@benjchristensen
benjchristensen / Money.java
Created December 7, 2011 07:44
Money.java
import static java.math.BigDecimal.*;
import static org.junit.Assert.*;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.NumberFormat;
@benjchristensen
benjchristensen / index.html
Created May 2, 2012 21:26
Line graph over time with multiple data points using SVG and d3.js
<html>
<head>
<title>Line graph over time with multiple data points using SVG and d3.js</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style>
body {
font-family: "Helvetica Neue", Helvetica;
}
/* tell the SVG path to be a thin blue line without any area fill */
@benjchristensen
benjchristensen / index.html
Created August 15, 2011 23:59
Animated Sparkline using SVG Path and d3.js
<html>
<head>
<title>Animated Sparkline using SVG Path and d3.js</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style>
/* tell the SVG path to be a thin blue line without any area fill */
path {
stroke: steelblue;
stroke-width: 1;
fill: none;
@benjchristensen
benjchristensen / index.html
Created December 13, 2011 19:34
Animated Circle using d3.js
<html>
<head>
<title>Animated Circle Using d3.js</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
</head>
<body>
<table>
<tr>
<td>
@benjchristensen
benjchristensen / RxJavaPublishZip.java
Created November 3, 2014 16:08
Example of using Observable.publish, observeOn and zip demonstrating backpressure
package reactive_streams_interop;
import java.util.concurrent.atomic.AtomicInteger;
import rx.Observable;
import rx.schedulers.Schedulers;
public class RxJavaPublishZip {
public static void main(String... args) {
@benjchristensen
benjchristensen / index.html
Created May 2, 2012 19:37
Line Graph with Dual-scaled Axes using SVG and d3.js
<html>
<head>
<title>Line Graph with Dual-scaled Axes using SVG and d3.js</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style>
/* tell the SVG path to be a thin blue line without any area fill */
path {
stroke-width: 1;
fill: none;
}
@benjchristensen
benjchristensen / RetryWhenTestsConditional.java
Created August 21, 2014 05:06
RetryWhenTestsConditional
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import rx.Observable;
import rx.Subscriber;
public class RetryWhenTestsConditional {
public static void main(String[] args) {
@benjchristensen
benjchristensen / RetryWhenTests.java
Created August 20, 2014 17:24
RetryWhen Example
import java.util.concurrent.TimeUnit;
import rx.Observable;
import rx.Subscriber;
public class RetryWhenTests {
public static void main(String[] args) {
Observable.create((Subscriber<? super String> s) -> {
@benjchristensen
benjchristensen / sync-rest-rpc.md
Last active January 15, 2018 07:24
Regarding synchronous RESTful communication ...

Response to https://twitter.com/jeffreymaxwell/status/705760483391963136 requiring more than the 77 characters left on Twitter.

DISCLAIMER: The quality of writing and thinking here is aligned with a Twitter conversation, not a blog post, presentation, or book ;-)

Synchronous RESTful communication between Microservices is an anti-pattern ... you seem to being saying that the Netflix architecture (hystrix, eureka, ribbon, ..) is broken ... hmm what would @benjchristensen say?