Skip to content

Instantly share code, notes, and snippets.

View bresson's full-sized avatar

Bresson bresson

  • New York, NY
View GitHub Profile
@bresson
bresson / reactive-architecture-reactive-microservices-notes.md
Created August 21, 2022 20:51 — forked from dmilan77/reactive-architecture-reactive-microservices-notes.md
Reactive Architecture: Reactive Microservices Course Notes

Monolith

The Monolithic Ball of Mud

  • The Ball Of Mud represents the worst case scenario for a Monolith. Also called as Spaghetti Code.
  • No clear isolation in the application.
  • Complex dependencies where everything depends on every other thing.
  • Hard to understand and harder to modify.

Cleaning Up The Ball Of Mud

  • To clean up the ball of mud we introduce isolation into the application by dividing the application along clear domain boundaries.
  • We introduce packages and libraries that help isolate related pieces of code. They provide a clean and consistent interface.
@bresson
bresson / Dockerfile
Created June 13, 2020 20:01
Dockerfile with base Ubuntu image, python3 and some data, science libs for High Performance Python
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y \
pkg-config \
curl \
libfreetype6-dev \
libc6-dev \
% Erlang "take" function in direct and tail recursion
-module(take).
-export([take/2, tctake/2, test_tctake/0]).
take(0,_) -> [];
take(_, []) -> [];
take(N, [X | _Xs]) ->
@bresson
bresson / index.html
Last active February 11, 2020 16:49
working geojson with extant, now with Saga #2
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div id="content">
@bresson
bresson / index.html
Last active February 11, 2020 03:04
working geojson with extant, now with Saga
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div id="content">
<svg width="400px" height="400px">
@bresson
bresson / .block
Created February 11, 2020 02:23 — forked from d3indepth/.block
Basic geo example
license: gpl-3.0
height: 420
border: no
@bresson
bresson / frequency.erl
Last active August 17, 2017 15:41
Erlang frequency server enhancements frequency.erl
% frequency server enhancements using list comprehension
% My first instinct was to solve this problem through recursion. However, I decided to use list comprehension / filter just to sample a new flavor. With list comprehension, I was able to pattern match but the process felt more like checking the length of the Frequencies/allocated list to determine if the request was valid.% If anyone can provide a hint, I had to create two functions, is_allocated and is_deallocated, the first to check if the Pid is already allocated a frequency and the second to check if a requested deallocate frequency was in fact allocated. The functions are very similar and should be one function. However, I couldn't figure out how to pass in a parameter that will inform the following line to check Client == Y or Client == X
% [X || {X, Y} <- Allocated, Client == Y].
init() ->
Frequencies = {get_frequencies(), []},
loop(Frequencies).
% Hard Coded
get_frequencies() -> [10,11,12,13,14,15].
-module(fibonacci).
-export([fibonacci/1]).
fibonacci(0) ->
0;
@bresson
bresson / functional composition
Last active December 24, 2016 01:59
Javascript experiment with functional composition allowing arbitrary number of composed functions through ES6, closure and tail recursion.
// experiment of functional composition
const addOne = a => a + 1;
const double = a => a * 2;
const square = a => a * a;
const lCompose = (...args) => {
const _lCompose = ( acc, ...args ) => {
@bresson
bresson / scrollTo.js
Created March 14, 2016 07:06 — forked from james2doyle/scrollTo.js
a native scrollTo function in javascript that uses requestAnimationFrame and easing for animation
// easing functions http://goo.gl/5HLl8
Math.easeInOutQuad = function (t, b, c, d) {
t /= d/2;
if (t < 1) {
return c/2*t*t + b
}
t--;
return -c/2 * (t*(t-2) - 1) + b;
};