Skip to content

Instantly share code, notes, and snippets.

{
"priority": [{
"if": "road_class == MOTORWAY && in_near_cottbus == false",
"multiply_by": 0
}],
"areas": {
"near_cottbus": {
"type": "Feature",
"properties": {},
"geometry": {
@karussell
karussell / Lettuce.java
Last active February 24, 2021 16:27 — forked from eransharv/RedissonSSL.java
java lettuce redis client example using SSL
client.setOptions(ClientOptions.builder().sslOptions(SslOptions.builder()
.keystore(new File("user.p12"), "test12".toCharArray())
.truststore(new File("keystore.jks"), "keystorepassword12")
.build()).build());
"schemas": {
"RouteRequest": {
"type": "object",
"properties": {
"custom_model": {
"description": "custom model bla",
"type": "object",
"properties": {
"speed": {
"type": "array",
class RandomTest {
@Test
public void randomGraph() {
long seed = 0;//System.nanoTime();
Random rand = new Random(seed);
FlagEncoder encoder = new CarFlagEncoder();
GraphHopperStorage graph = new GraphHopperStorage(new RAMDirectory(), EncodingManager.create(encoder), false).create(100);
GHUtility.buildRandomGraph(graph, rand, 1000, 3, true, true,
@karussell
karussell / MyTest.java
Last active January 27, 2021 11:13
IntelliJ Debugging for Janino
class MyTest {
@Test
public void testX() throws CompileException {
IScriptEvaluator se = new ScriptEvaluator();
MyInterface i = (MyInterface) se.createFastEvaluator(""
+ "System.out.println(\"Hello\");\n"
+ "String s = \"World\";\n"
+ "System.out.println(s);\n"
+ "return true;",
MyInterface.class, new String[0]);
/*
* Copyright (c) 2014, Oracle America, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
@karussell
karussell / leaflet_hosted.ipynb
Created July 28, 2020 13:41
routing api via jupyter
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@karussell
karussell / customizable-routing.ipynb
Last active July 28, 2020 12:33
customizable routing - the notebook needs to be trusted to run JavaScript which is required for the leaflet maps or view it on https://nbviewer.jupyter.org/gist/karussell/5b799b253e608a93aeb6b120ccc8e67a
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
graphhopper:
datareader.file: ""
graph.location: graph-cache
graph.flag_encoders: car|turn_costs=true
profiles:
- name: car
vehicle: car
weighting: fastest