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
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 / 0.md
Last active Jul 5, 2019
notes for Bug 1563226
View 0.md
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 / index.html
Last active Oct 17, 2018
IDB list perfs
View index.html
<!DOCTYPE html>
<html>
<head>
<script src="//unpkg.com/kinto@12.1.1/dist/kinto.noshim.js"
integrity="sha384-HAvdRnGimsCGQDQo6XnILXgZ3rJGI2RGQXdrH0wLZURMuFNyZIvYOOrAwgs2nsgj"
crossorigin="anonymous">
</script>
</head>
<body>
<h1>Benchmark</h1>
View load-dictionaries.py
import os
import requests
import kinto_http
ACCESS_TOKEN = os.getenv("TOKEN", "")
SERVER = os.getenv("SERVER", "https://settings-writer.stage.mozaws.net/v1")
DICT_URL = os.getenv("SOURCE", "https://github.com/mozilla-l10n/firefox-dictionaries/raw/master/output/dictionaries_minimal.json")
DOC_URL = "https://remote-settings.readthedocs.io/en/latest/frequently-asked-questions.html#how-do-i-automate-the-publication-of-records"
View publish-psl.sh
SERVER=https://kinto.dev.mozaws.net/v1
BUCKET=main
COLLECTION=public-suffix-list
RECORD=b719eacd-96ed-4979-bfd8-538fd39d9c05 # uuidgen
echo
echo "Create user"
curl -X PUT ${SERVER}/accounts/psl \
-H 'Content-Type:application/json' \
-d '{"data": {"password": "psl-secret"}}' \
@leplatrem
leplatrem / snippet.yaml
Last active Oct 11, 2018
Remote Settings Example Schema
View snippet.yaml
attachment:
enabled: true
required: true
displayFields:
- details.name
- incremental
- attachment.filename
schema:
type: object
description: Certificate revocation data.
View delete-collections.sh
USERPWD=user:pass
SERVER=https://kinto-writer.stage.mozaws.net/v1
for cid in 2a0b9078-a798-4f37-b5f3-9cd7eebda544 66cd6e46-e925-413d-a992-d725703ff65f 3db1da84-a687-4c3f-bc06-e57829fe9629 1484aaaa-6d94-4a96-bd08-fd9aab2deaa2 qatest-2 qatest2 qatest qatest1 qatest123 0800b409-53ec-4987-b22d-15e990a7d405 baidvv4w3v5tap7y bicyolhzprhvu4ey bmduchjvfkgusq6a bjyzvcvzeuzacyty 50c3b114-8fb6-4dec-a262-bd36e8e97d1f 0b568598-079d-4cb6-95b0-d4a6c3296b4d 182f2e43-6af7-447a-b38b-72eaf810476f qa-test abc BtkWLaXr ivufVz0q eFh34Dtz DKCqLcZk; do
curl -X DELETE $SERVER/v1/buckets/main-workspace/groups/$cid-editors -u $USERPWD
curl -X DELETE $SERVER/v1/buckets/main-workspace/groups/$cid-reviewers -u $USERPWD
curl -X DELETE $SERVER/v1/buckets/main-workspace/collections/$cid -u $USERPWD
curl -X DELETE $SERVER/v1/buckets/main-preview/collections/$cid -u $USERPWD
curl -X DELETE $SERVER/v1/buckets/main/collections/$cid -u $USERPWD
done
You can’t perform that action at this time.