Skip to content

Instantly share code, notes, and snippets.

View RanKey1496's full-sized avatar
馃幆
Focusing

Jhon Gil Sepulveda RanKey1496

馃幆
Focusing
  • Medell铆n - Colombia
View GitHub Profile
{
"value":700000,
"status":"PROMOCION",
"property":{
"type":"CASA",
"neighborhood":"CAMPO VALDES",
"sector":"NORORIENTE",
"city":"MEDELLIN",
"latitude":6.275141,
"longitude":-75.554989,
@RanKey1496
RanKey1496 / Utils.java
Created May 6, 2019 04:14
Google Polyline encoder written in Java
public class Utils {
private static final double DEFAULT_PRECISION = 1E5;
private static String encodeDiff(int diff) {
StringBuilder str = new StringBuilder();
int shifted = diff << 1;
if (diff < 0) {
shifted = ~shifted;
}
@RanKey1496
RanKey1496 / Utils.java
Created May 6, 2019 04:15
Google polyline decoder written in Java
import org.locationtech.jts.geom.*;
public class Utils {
private static final double DEFAULT_PRECISION = 1E5;
public static LineString decodePolyline(String encoded) {
return decodePolyline(encoded, DEFAULT_PRECISION);
}
@RanKey1496
RanKey1496 / Utils.java
Created May 6, 2019 04:16
Convert String to LineString or Point written in Java
public class Utils {
private static final int GEOMETRY_PRECISION = 4326;
public static Point convertStringToPoint(String encode) {
try {
if (encode == null || encode.length() <= 0)
return null;
String[] coordinates = encode.replaceFirst("POINT ?\\(", "").replaceFirst("\\)", "").split(" ");
@RanKey1496
RanKey1496 / onion-demo.md
Created January 31, 2023 17:24 — forked from cdiaz/onion-demo.md
Arquitectura cebolla

Node.js y la arquitectura en capas de cebolla con InversifyJS

Este ejemplo demuestra c贸mo integrar InversifyJS con Express y como implementar aplicaciones que se adhieren a la arquitectura en capas de cebolla. Esta arquitectura de capas puede representarse en un diagrama como sigue:

onion

La principal diferencia entre una arquitectura de n-capas tradicional y la arquitectura cebolla es la direcci贸n de las dependencias entre capas.

En la arquitectura cebolla aplicamos el principio de inversi贸n de dependencias. Los detalles de la implementaci贸n (infraestructura) depende de las abstracciones (dominio):