Skip to content

Instantly share code, notes, and snippets.

View leplatrem's full-sized avatar

Mathieu Leplatre leplatrem

View GitHub Profile
@leplatrem
leplatrem / geojson-collection
Created June 12, 2013 21:55
Daybed GeoJSON profile
* FeatureCollection
* Feature properties contains unique ``id`` field
@leplatrem
leplatrem / gist:6552003
Last active December 23, 2015 00:09
Auto-login middleware
from urlparse import urlparse
from django.conf import settings
from django.contrib.auth import get_user_model
User = get_user_model()
CONVERSION_SERVER_HOST = urlparse(settings.CONVERSION_SERVER).hostname
try:
@leplatrem
leplatrem / popup_home.html
Last active December 28, 2015 23:59
Popup example
<section>
<div class="header">
<img class="logo" src="/media/logo.png" alt="logo">
<h1>Rando, l'offre de randonnée pour découvrir le patrimoine du Parc.</h1>
</div>
<div class="row-fluid">
<div class="span4">
<a href="/#search" class="pjax profile">
<img src="/media/search.jpg" alt="logo">
<span class="caption">Recherche</span>
@leplatrem
leplatrem / mbtiles_split.py
Created January 14, 2014 09:38
Split a big MBTiles into smaller ones, based on column index
#!/usr/bin/env python
import os
import sys
import shutil
import subprocess
class UserError(Exception):
pass
Verifying that +leplatrem is my blockchain ID. https://onename.com/leplatrem
@leplatrem
leplatrem / index.html
Created January 22, 2016 12:05
benchmark kinto
<!DOCTYPE html>
<html>
<head>
<script src="kinto-dev.js"></script>
</head>
<body>
<h1>Benchmark</h1>
<p><span id="count">?</span> records in <span id="time">?</span> sec.
<button id="run">Run</button>
<button id="clear">Clear</button>
@leplatrem
leplatrem / load.py
Created January 25, 2016 09:06
Import json records in Kinto
import json
import uuid
from kinto_client import Client
client = Client(server_url="https://kinto-leplatrem.herokuapp.com/v1",
auth=('admin', 'password'))
client.create_bucket('guessign', safe=False)
try:

Update Kinto.js in Firefox

Compile Firefox

First, follow the instructions to build Firefox.

Run Kinto tests

$ ./mach xpcshell-test services/common/tests/unit/test_kinto.js
[{
"versions": [{
"minVersion": "0",
"maxVersion": "*",
"severity": 3,
"vulnerabilityStatus": 0,
"targetApps": {
"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}": [{
"minVersion": null,
"maxVersion": null
@leplatrem
leplatrem / 1263602.patch
Last active April 11, 2016 15:09
Bug 1263602 - Untested code to verify signatures
diff --git a/services/common/KintoCertificateBlocklist.js b/services/common/KintoCertificateBlocklist.js
--- a/services/common/KintoCertificateBlocklist.js
+++ b/services/common/KintoCertificateBlocklist.js
@@ -13,16 +13,20 @@ Cu.import("resource://services-common/mo
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "uuidgen",
"@mozilla.org/uuid-generator;1",