Skip to content

Instantly share code, notes, and snippets.

@pgiraud
pgiraud / ExtendedRenderers.js
Last active April 4, 2024 19:09
OpenLayers 2 - Direction arrows along linestrings
/* Copyright Pierre GIRAUD, https://gist.github.com/pgiraud/6131715
* Published under WTFPL license. */
/**
* @requires OpenLayers/Renderer/SVG.js
*/
OpenLayers.Renderer.SVGExtended = OpenLayers.Class(OpenLayers.Renderer.SVG, {
eraseGeometry: function(geometry, featureId) {
this.removeArrows(geometry);
@pgiraud
pgiraud / index.html
Last active January 18, 2023 09:53
Elevation Profile d3js
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
.axis path,
.axis line {
@pgiraud
pgiraud / README.md
Last active November 25, 2022 05:29
Polygon intersection with JSTS

This example shows the usage of JSTS to compute the intersection of polygons.

Once the vector layer shows up, you can draw a polygon on the map. Within a small amount of time, you should see the result of intersection highlighted in blue.

Link to demo

@pgiraud
pgiraud / app.js
Last active September 29, 2020 20:14
OpenLayers 2 ESRI XYZ layers
var map, layer;
function init(){
map = new OpenLayers.Map('map', {
layers: [new OpenLayers.Layer.OSM()]
});
layer = new OpenLayers.Layer.XYZ( "ESRI",
"https://services1.arcgis.com/rMlsWo8szOzlrpCq/arcgis/rest/services/danger_d_avalanche/MapServer/tile/${z}/${y}/${x}",
{sphericalMercator: true, isBaseLayer: false}
);
map.addLayer(layer);
@pgiraud
pgiraud / README.md
Last active May 22, 2020 07:41
Statements
docker run --rm --name statements -e POSTGRES_PASSWORD=postgres -d -p 5432:5432 postgres
export PGUSER=postgres
export PGPASSWORD=postgres
export PGHOST=0.0.0.0
psql -f init.sql
psql -f populate.sql
psql -f chart.sql
@pgiraud
pgiraud / leaflet-big-image-full.html
Created May 8, 2020 10:58 — forked from longhotsummer/leaflet-big-image-full.html
Full example of using leaflet to pan and zoom a big image, as described at http://kempe.net/blog/2014/06/14/leaflet-pan-zoom-image.html
<html>
<!-- See also: http://kempe.net/blog/2014/06/14/leaflet-pan-zoom-image.html -->
<head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css"></script>
<style>
#image-map {
width: 100%;
height: 300px;
border: 1px solid #ccc;
margin-bottom: 10px;
@pgiraud
pgiraud / light_chart_visible.html
Created April 18, 2019 07:43
pgBadger performance improvements
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html lang="en">
<head>
<title>pgBadger :: PostgreSQL Log Analyzer</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex,nofollow">
<meta http-equiv="Expires" content="Thu Apr 18 08:57:27 2019">
<meta http-equiv="Generator" content="pgBadger v10.3">
<meta http-equiv="Date" content="Thu Apr 18 08:57:27 2019">
<link rel="shortcut icon" href="data:image/x-icon;base64,
@pgiraud
pgiraud / simple_python_datasource.py
Created August 16, 2018 07:27 — forked from linar-jether/simple_python_datasource.py
Grafana python datasource - using pandas for timeseries and table data. inspired by and compatible with the simple json datasource
from flask import Flask, request, jsonify, json, abort
from flask_cors import CORS, cross_origin
import pandas as pd
app = Flask(__name__)
cors = CORS(app)
app.config['CORS_HEADERS'] = 'Content-Type'
@pgiraud
pgiraud / index.html
Created June 25, 2018 08:02
Dygraph no data - temboard monitoring
.
@pgiraud
pgiraud / .editorconfig
Last active April 24, 2018 14:51
temBoard monitoring with alerts - tests D3
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 4
# Unix-style newlines
end_of_line = lf
# Remove any whitespace characters preceding newline characters
trim_trailing_whitespace = true