Skip to content

Instantly share code, notes, and snippets.

Pirmin Kalberer pka

Block or report user

Report or block pka

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 filter_actors.rs
extern crate actix;
extern crate futures;
use actix::dev::{MessageResponse, ResponseChannel};
use actix::*;
use futures::{future, Future};
use std::env;
// Message and Response data type
#[derive(Debug)]
@pka
pka / quickfinder.sql
Last active Jun 9, 2017
Quickfinder adress search example
View quickfinder.sql
CREATE MATERIALIZED VIEW av.adressen AS
SELECT hau.pk, lok.r1_text || COALESCE(' ' || hau.r1_hausnum, '') AS adresse, hau.wkb_geometry
FROM av.ge_hausnummerpos hau
JOIN av.ge_lokalisationsnamepos lok ON lok.r1_benannt=hau.r1_gebaeud;
CREATE INDEX adressen_trgm_idx ON av.adressen USING gin (adresse gin_trgm_ops);
SELECT adresse,ST_AsBinary(wkb_geometry)::geometry
FROM av.adressen
WHERE similarity(adresse, %(search)s) > 0.2
@pka
pka / index.html
Last active Dec 17, 2015
Progressive WMS
View index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="stylesheet" href="http://dev.openlayers.org/releases/OpenLayers-2.12/theme/default/style.css" type="text/css">
<link rel="stylesheet" href="http://dev.openlayers.org/releases/OpenLayers-2.12/examples/style.css" type="text/css">
<script src="http://dev.openlayers.org/releases/OpenLayers-2.12/OpenLayers.light.js"></script>
<script type="text/javascript">
View x.js
// generated by create search command
CmdUtils.makeSearchCommand({
name: "rails",
url: "http://apidock.com/rails/search?query={QUERY}",
icon: "http://apidock.com/images/favicon.ico",
parser: {
container: "#main_body > .result",
title: ".result_title > h3 > a",
maxResults: 10,
},
You can’t perform that action at this time.