Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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
def test_mock_open(mocker):
with mocker.patch('builtins.open', mocker.mock_open(read_data='foo')):
with open(__file__) as f:
assert f.read() == 'foo'
@pgiraud
pgiraud / script.py
Created June 9, 2017 09:12
Test effective userid python subprocess
#! /bin/python
import subprocess
import os
print("subprocess.call")
print("Without seteuid")
subprocess.call(['id', '-u'])
print("With seteuid")
#! /usr/bin/python
import time
start = time.time()
for i in range(100000000):
if False and 'blue' in 'sky is blue':
pass
end = time.time()
print(end - start)
<video autoplay="yes" loop="yes" poster="mastering-layers.687ac430.png">
<source src="http://bluecarto.free.fr/temboard.webm" type="video/webm">
</video>