Skip to content

Instantly share code, notes, and snippets.

Mathieu Leplatre leplatrem

Block or report user

Report or block leplatrem

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
@leplatrem
leplatrem / app.py
Created Oct 11, 2011
Simple Flask-couchdb demo
View app.py
import simplejson
from flask import Flask, g, request
from couchdb.design import ViewDefinition
import flaskext.couchdb
app = Flask(__name__)
"""
CouchDB permanent view
View Arpit_Bharti_GSoC_2019_Report.md

Arpit Bharti - GSoC 2019 Progress Report

Project - Ship the Public Suffix List (PSL) over Remote Settings

Organization - Mozilla

Project Mentor - Mathieu Leplatre

Summary

View kinto-offline-client.js
/*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@leplatrem
leplatrem / gist:1415767
Created Dec 1, 2011
Leaflet Offline Tiles using SQL Storage
View gist:1415767
/*
* L.TileLayer.LocalCache : A tile layer using SQL Storage, if available.
*/
L.TileLayer.LocalCache = L.TileLayer.extend({
options: {
minZoom: 0,
maxZoom: 18,
tileSize: 256,
subdomains: 'abc',
@leplatrem
leplatrem / yourapp
Last active Jul 29, 2019
gunicorn virtualenv init.d script (could be simpler with upstart)
View yourapp
#! /bin/bash
### BEGIN INIT INFO
# Provides: yourapp
# Required-Start: nginx
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: The main django process
# Description: The gunicorn process that receives HTTP requests
# from nginx
@leplatrem
leplatrem / 0.md
Last active Jul 5, 2019
notes for Bug 1563226
View 0.md
View gist:5729022
CREATE OR REPLACE FUNCTION SimplifyEdgeGeom(atopo varchar, anedge int, maxtolerance float8)
RETURNS float8 AS $$
DECLARE
tol float8;
sql varchar;
BEGIN
tol := maxtolerance;
LOOP
sql := 'SELECT topology.ST_ChangeEdgeGeom(' || quote_literal(atopo) || ', ' || anedge
|| ', ST_Simplify(geom, ' || tol || ')) FROM '
View gist:88b6bbf48c7a7abdd3e9b9b16b38eaf4
make up
docker-compose kill
./scripts/build.sh
Sending build context to Docker daemon 17.66MB
Step 1/11 : FROM python:3.6
---> 4f13b7f2138e
Step 2/11 : ENV PYTHONDONTWRITEBYTECODE 1
---> Using cache
---> 9db6e2d323b4
Step 3/11 : WORKDIR /app
View merge.py
import os
from github import Github
WITH_BORS = [("mozilla-services", "kinto-dist")]
def main():
g = Github(os.getenv("TOKEN"))
@leplatrem
leplatrem / mirror_archives.py
Last active Nov 19, 2018
mirror_archives.py
View mirror_archives.py
import asyncio
import json
import os
import re
from urllib.parse import urlparse
import async_timeout
import aiohttp
import backoff
You can’t perform that action at this time.