Skip to content

Instantly share code, notes, and snippets.

Carsten Keßler crstn

Block or report user

Report or block crstn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View kommunertopo.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@crstn
crstn / RDF in Turtle to PDF Graph
Last active Sep 15, 2018
Create a graph visualization from an RDF file using http://librdf.org/raptor/ and http://www.graphviz.org.
View RDF in Turtle to PDF Graph
rapper -i turtle -o dot model.ttl | dot -Tpdf -omodel.pdf
View datashader.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@crstn
crstn / voronoi.r
Created Jan 17, 2018
This is a small fix of Carson Farmer's Voronoi Polygons function (http://carsonfarmer.com/2009/09/voronoi-polygons-with-r/) which also copies the input points layer's CRS string over to the output polygons.
View voronoi.r
voronoipolygons = function(layer) {
require(deldir)
crds = layer@coords
z = deldir(crds[,1], crds[,2])
w = tile.list(z)
polys = vector(mode='list', length=length(w))
require(sp)
for (i in seq(along=polys)) {
pcrds = cbind(w[[i]]$x, w[[i]]$y)
pcrds = rbind(pcrds, pcrds[1,])
@crstn
crstn / README.txt
Created Oct 2, 2012 — forked from flaviaza/README.txt
Twitter bootstrap fixed table header using jQuery
View README.txt
Here is a simple jQuery plugin to make a table header fixed on top of a div when this is scrolled.
Using the code from twitter bootstrap documentation page, this code is customized for table header.
Create the table with following layout -
<div class="row fixed-table">
<div class="table-content">
<table class="table table-striped table-fixed-header" id="mytable">
<thead class="header">
<tr>
<th>Email Address</th>
View rats-dynamic.html
<html>
<head>
<title>A D3 chart</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
</head>
<body>
<script>
@crstn
crstn / definer.sql
Last active Aug 31, 2016
Editing data in a CartoDB table via Leaflet with leaflet.draw plugin. Heavily inspired by http://blog.cartodb.com/read-and-write-to-cartodb-with-the-leaflet-draw-plugin/.
View definer.sql
DROP FUNCTION IF EXISTS carsten_upsert_pois(int[], text[]);
-- Returns a set of op,cartodb_id values where op means:
--
-- deleted: -1
-- updated: 0
-- inserted: 1
--
CREATE OR REPLACE FUNCTION carsten_upsert_pois(
cartodb_ids integer[],
@crstn
crstn / gist:6552662
Last active Dec 23, 2015
Transforms JSON files exported from the moves API [1] into GeoJSON, which can then be used in a number of applications, such as CartoDB or Leaflet. [1] http://dev.moves-app.com
View gist:6552662
<?php
// this is the directory where you have your json files from the moves API stored
$dir = "/my/input/dir";
// this is where your geojson files will be stored
$outdir = "/my/output/dir";
$geojsonplaces = [
"type" => "FeatureCollection",
"features" => [ ],
];
@crstn
crstn / Query 1: Get all counts, sorted by date (new to old).sparql
Last active Dec 20, 2015
Demo for point in time data in HXL. See comments below for a how-to.
View Query 1: Get all counts, sorted by date (new to old).sparql
prefix hxl: <http://hxl.humanitarianresponse.info/ns/#>
SELECT ?population ?count ?date
WHERE {
GRAPH ?g {
?population hxl:personCount ?count .
?g hxl:validOn ?date .
}
} ORDER BY ?population DESC(?date)
@crstn
crstn / tomcat-users.xml
Created Oct 15, 2015
Tomcat user configuration for Strabon
View tomcat-users.xml
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<user username="endpoint" password="endpoint" roles="manager"/>
</tomcat-users>
You can’t perform that action at this time.