View needsdiagnosis-monitor.py
#!/usr/bin/env python3
# encoding: utf-8
"""
Monitor the needsdiagnosis milestones.
Created by Karl Dubost - 2018-02-18
"""
import datetime
import json
View build-tools.md

Build Tools For Webcompat

webcompat is an opensource project. It relies on the effort of Mozilla webcompat team and contributions from volunteers across the world. Microsoft Edge team and Google Chrome team are also participating time to time.

There are different areas were you can create an impact on developing tools including:

View something.py
>>> from lxml.html.diff import htmldiff, html_annotate
>>> frag1 = """<li class="foo" id="barbitruc">"""
>>> frag2 = """<li id="barbitruc" class="foo">"""
>>> print htmldiff(frag1, frag2)
<li id="barbitruc" class="foo">
>>> htmldiff(frag1, frag2)
u'<li id="barbitruc" class="foo">'
>>> '<ins>' in htmldiff(frag1, frag2)
False
>>> '<del>' in htmldiff(frag1, frag2)
View to_review.txt
2017-10-30T10:13:24 INFO Issue 97. No label. Review!
2017-10-30T10:14:09 INFO Issue 137. No label. Review!
2017-10-30T10:14:16 INFO Issue 144. No label. Review!
2017-10-30T10:14:21 INFO Issue 150. No label. Review!
2017-10-30T10:14:21 INFO Issue 151. Too many labels. Review!
2017-10-30T10:14:21 INFO Issue 152. No label. Review!
2017-10-30T10:14:21 INFO Issue 153. No label. Review!
2017-10-30T10:14:33 INFO Issue 164. No label. Review!
2017-10-30T10:14:39 INFO Issue 171. No label. Review!
2017-10-30T10:14:58 INFO Issue 188. No label. Review!
View blah.md

Safari iOS Request

Host: na.finalfantasyxiv.com
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Connection: keep-alive
Accept-Language: fr-fr
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.3 Mobile/14E277 Safari/603.1.30
Cookie: _ga=GA1.2.1480447581.1502240550; _gat=1; _gat_anotherTracker=1; _gid=GA1.2.1718704641.1502240550; ldst_sess=33b25094105b35baeb93a5418090fb06bdad98f7; ldst_is_support_browser=1; ldst_touchstone=1
View faster_dict.md

It is faster to create the dict with the first value than creating and adding.

python -mtimeit "issue = {}; issue['action'] = 'opened'; issue['title'] = 'foo'"
10000000 loops, best of 3: 0.135 usec per loop

python -mtimeit "issue = {'action': 'opened'}; issue['title'] = 'foo'" 
10000000 loops, best of 3: 0.111 usec per loop
View 001-regex.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import urlparse
import re
import sys
View gist:5cd79259e696e0a52eaff35951b21803
# done some commits on last version of master by mistakes
# and some modifications still not committed
git stash
git branch my_new_branch
git reset --hard origin/master
git checkout my_new_branch
git stash pop
# I'm now on my new branch as I should have been
View issues_stats.py
import json
RESULTS = '''
new format: {new}
old format: {old} # can't conclude anything
---------------------
INVALID: On {invalid} > empty: {empty_invalid}
VALID: On {valid} > empty: {empty_valid}
'''
View google-search.js
(function() {
(function() {
if (!google.xjsir)
if (google.q && google.q.iere) {
for (var d = document.querySelectorAll("#topstuff,#fc,.ichpcnt,#fsad"), a = 0; a < d.length; a++) d[a].classList.add("qs-css-m");
var c = document.getElementById("rg");
c ? (c.style.webkitAnimationDelay = "150ms", c.classList.add("qs-css-m"), c.addEventListener("webkitAnimationEnd", function() {
c.style.webkitAnimationDelay = "";
document.documentElement.classList.remove("qs-css-a");
if (google.isr && google.isr.layout && google.isr.layout.getResultsForPage) {