Skip to content

Instantly share code, notes, and snippets.

Peter Bengtsson peterbe

Block or report user

Report or block peterbe

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 main2.py
import os
import json
from git import Git
def run(cwd):
g = Git(cwd)
loginfo = g.log("--pretty=format:metadata:%aD,%an,%ae", "--name-only")
last_modified = {}
View main.js
const fs = require("fs");
var childProcess = require("child_process");
function run(cwd) {
const cmd = "git";
const args = ["log", "--pretty=format:metadata:%aD,%an,%ae", "--name-only"];
const perFile = {};
const lastModified = {};
// const lastModified = new Set();
@peterbe
peterbe / Always the first 2
Last active Jan 24, 2020
Distribution of en-US MDN content by prefix
View Always the first 2
TOP 25
1 Web/API 5468 28.7%
2 Archive/Mozilla 1752 9.2%
3 Mozilla/Tech 1557 8.2%
4 Mozilla/Projects 1373 7.2%
5 Web/CSS 1014 5.3%
6 Archive/B2G_OS 1001 5.3%
7 Web/JavaScript 995 5.2%
8 Mozilla/Add-ons 684 3.6%
9 Archive/Add-ons 406 2.1%
@peterbe
peterbe / readme.md
Last active Jan 16, 2020
How to debug Interactive Examples in Kuma
View readme.md

Basics

First set this in your kuma .env file:

INTERACTIVE_EXAMPLES_BASE=http://localhost:9090

Now, start kuma (docker-compose up) and navigate to a page that as an Interactive Example. In a separate terminal go into the interactive-examples repo and type:

npm run start
View index.yaml
title: <video>
mdn_url: /fr/docs/Web/HTML/Element/video
slug: Web/HTML/Element/video
locale: fr
modified: 2020-01-10T00:00:31.617Z
mdn_contributors:
- SphinxKnight
- supergonzales
- mdnwebdocs-bot
- Grivel-l
View editor.diff
2c2
< <div class="CodeMirror cm-s-default CodeMirror-focused">
---
> <div class="CodeMirror cm-s-default">
13c13
< style="right: 0px; left: 30px; height: 18px; pointer-events: none;"
---
> style="height: 18px; pointer-events: none;"
22c22
< style="margin-left: 30px; margin-bottom: 0px; border-right-width: 30px; min-height: 155px; min-width: 687px; padding-right: 0px; padding-bottom: 0px;"
View gist:2d2efebf872040fc6c735e4faaa45268
web_1 | Traceback (most recent call last):
web_1 | File "/usr/local/lib/python3.8/site-packages/django/contrib/staticfiles/handlers.py", line 63, in __call__
web_1 | return self.application(environ, start_response)
web_1 | File "/usr/local/lib/python3.8/site-packages/django/core/handlers/wsgi.py", line 157, in __call__
web_1 | response = self.get_response(request)
web_1 | File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", line 124, in get_response
web_1 | response = self._middleware_chain(request)
web_1 | File "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 43, in inner
web_1 | response = response_for_exception(request, exc)
web_1 | File "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 93, in response_for_exception
View doc-indexed.json
{
"id": 985,
"boost": 1.0,
"title": "<span>",
"slug": "Web/HTML/Element/span",
"summary": "The HTML span element is a generic inline container for phrasing content, which does not inherently represent anything. It can be used to group elements for styling purposes (using the class or id attributes), or because they share attribute values, such as lang.",
"locale": "en-US",
"modified": "2020-01-02T07:21:45.905",
"content": "\n\nThe HTML &lt;span&gt; element is a generic inline container for phrasing content, which does not inherently represent anything. It can be used to group elements for styling purposes (using the class or id attributes), or because they share attribute values, such as lang. It should be used only when no other semantic element is appropriate. &lt;span&gt; is very much like a &lt;div&gt; element, but &lt;div&gt; is a block-level element whereas a &lt;span&gt; is an inline element....\n\n\n\nThe source for this interactive example is stored in a GitHub repository. If
View react-mdn.6ee517b0c3a5.css
@charset "UTF-8";
.offscreen,
.only-icon span {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
View default.txt
https://gist.github.com/peterbe/5c70b12ec88072b3890f588d7d15d233
You can’t perform that action at this time.