Skip to content

Instantly share code, notes, and snippets.

View oliverheilig's full-sized avatar
💾
Loading...

Oliver Heilig oliverheilig

💾
Loading...
View GitHub Profile
@oliverheilig
oliverheilig / TALux.geojson
Last active August 29, 2015 14:04
Truck Attributes as GeoJson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// Calcluate airline distance for two mercator points.
// This approximation formula is sufficiently accurate for
// our needs for distances of up to 600 km and
// 80° latitude (the error is never more than 5% even for extreme values).
using System;
public class Program
{
public static void Main()
{
@oliverheilig
oliverheilig / lux_communes.topo.json
Created August 19, 2015 13:32
Luxmenbourg municipalities as TopoJson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oliverheilig
oliverheilig / lux_postcode.topo.json
Created August 19, 2015 14:19
Luxembourg postcodes as TopoJson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Hiding your xServer internet token

The xServer internet token is an API-key used to authenticate and bill the requests.

If a client-application accesses xServer internet directly, the token can be sniffed by intercepting the traffic or looking into the code. However, the API-key cannot be used to access any security relevant customer data. If you don’t want to expose the token to the client, you can proxy the xServer internet access in your application server and inject your token here.

Here are two scenarios to create a proxy that injects an xServer internet token.

1. Use Apache as Proxy

You can add a virtual host to proxy your xServer-Requests, by configuring the httpd-vhosts.conf. The xServer can be acessesed with the authentication of your WebServer then, while the requests are relayed and the token is injected.

@oliverheilig
oliverheilig / GeoDistance.cs
Last active December 25, 2015 19:19
CalcDistance
// Calcluate airline distance based on mercator distance.
// This approximation formula is sufficiently accurate for
// our needs for distances of up to 600 km and
// 80° latitude (the error is never more than 5% even for
// extreme values).
using System;
public class Program {
public static void Main () {
double lat1 = 49.0;
@oliverheilig
oliverheilig / PointInRangeOfLinestring.cs
Last active December 25, 2015 19:49
PointNearLinestring
// This snippet shows how to check whether a point is near a
// polyline. For a given polyline you can check if the
// distance of a point to the line string is not greater
// a certain value.
// You can use this for geo-fencing or UI hit-testing.
using System;
using System.Collections.Generic;
using JSIL;
using JSIL.Meta;

Graphing Widget

The graphing widget shows graphs using the Rickshaw graphing library. The names of data fields should be (vaguely) familiar if you've used Rickshaw before.

It's recommended that you replace the /assets/javascripts/rickshaw.min.js from your dashboard with the latest from here.

Supported HTML data fields

#map {
position: absolute;
left: 0px;
right: 0px;
top: 00px;
bottom: 0px;
}
#range {
top: 00px;
left: 0px;
#map {
position: absolute;
left: 0px;
right: 0px;
top: 0px;
bottom: 0px;
}
#range {
top: 10px;
left: 0px;