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 default.txt
#!/bin/bash
set -e
export KUBECONFIG=~/.kube/oregon.config # Was this needed?!
cd /Users/peterbe/dev/MOZILLA/MDN/infra/apps/mdn/mdn-aws/k8s
source regions/oregon/prod.sh # change to stage.sh for Stage
# Can't use aliases!
name=`kubectl -n mdn-prod get pods | grep 'web-' | head -n 1 | awk '{ print $1 }'`
View gist:971aee0107160d96b759fa235f17804e
▶ yarn start ../stumptown/packaged ~/stumptown-content/kumapackaged/api/v1/doc/en-US/Web ~/stumptown-content/kumapackaged/api/v1/doc/ja --quiet
yarn run v1.19.1
$ yarn build && node dist/cli.js ../stumptown/packaged /Users/peterbe/stumptown-content/kumapackaged/api/v1/doc/en-US/Web /Users/peterbe/stumptown-content/kumapackaged/api/v1/doc/ja --quiet
$ webpack --config webpack.config.js --mode=development
...
About to process ../stumptown/packaged (78 files)
Progress: [·······························································································································································································] | 100.0%
About to process /Users/peterbe/stumptown-content/kumapackaged/api/v1/doc/en-US/Web (15,665 files)
Progress: [·······························································································································································································] | 100.0%
View banners.jsx
function Banner(props: BannerProps) {
const [isDismissed, setDismissed] = useState(false);
const [cssLoaded, setCssLoaded] = useState(false);
useEffect(() => {
if (!cssLoaded) {
const link = document.createElement('link')
link.rel = 'stylesheet'
link.href = '/static/css/builds/banners.hash.css'
link.onload = () => {
View gist:1dcda46c41aeb875e44bad54fb4aad4c
11381 en-US
3597 en-US/Web/API
3097 ja
2737 pl
2134 fr
1377 es
1241 en-US/DOM
1166 en-US/Web/CSS
923 fr/Web/CSS
817 zh-CN
View default.diff
diff --git a/yarn.lock b/yarn.lock
index 5c441e0..be623c8 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2016,7 +2016,7 @@ arr-diff@^4.0.0:
resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520"
integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=
-arr-flatten@^1.0.1, arr-flatten@^1.1.0:
+arr-flatten@^1.0.1:
View gist:cc4f8557297d5915885762fd1f69da5a
Wrote ../client/build/en-US/docs/Learn/HTML/Introduction_to_HTML/Structuring_a_page_of_content/index.json 9ms
Wrote ../client/build/en-US/docs/Learn/HTML/Introduction_to_HTML/index.json 3ms
Wrote ../client/build/en-US/docs/Learn/HTML/Introduction_to_HTML/Marking_up_a_letter/index.json 3ms
Wrote ../client/build/en-US/docs/Learn/HTML/Introduction_to_HTML/HTML_text_fundamentals/index.json 2ms
Wrote ../client/build/en-US/docs/Learn/HTML/Introduction_to_HTML/The_head_metadata_in_HTML/index.json 1ms
Wrote ../client/build/en-US/docs/Learn/HTML/Introduction_to_HTML/Getting_started/index.json 1ms
Wrote ../client/build/en-US/docs/Learn/HTML/Introduction_to_HTML/Debugging_HTML/index.json 1ms
Wrote ../client/build/en-US/docs/Learn/HTML/Introduction_to_HTML/Document_and_website_structure/index.json 1ms
Wrote ../client/build/en-US/docs/Learn/HTML/Introduction_to_HTML/Advanced_text_formatting/index.json 2ms
Wrote ../client/build/en-US/docs/Learn/HTML/Introduction_to_HTML/Creating_hyperlinks/index.json 1ms
View peterbe_restore_mysql.py
#!/usr/bin/env python3
import subprocess
import datetime
import time
import os
import shutil
from glob import glob
def run():
View peterbe_backup_mysql.py
#!/usr/bin/env python3
import subprocess
import datetime
import time
import os
out = subprocess.check_output(["docker", "ps"]).decode("utf-8")
docker_id, = [
x.split()[0] for x in out.splitlines() if x.split()[1].startswith("mysql:")
]
View valid_ids.py
import os
import sys
import json
from pathlib import Path
import re
from functools import lru_cache
from pyquery import PyQuery
View default.txt
"Contexte_d'usage"
'attr-xml:base'
'attr-xml:lang'
'attr-xml:space'
"Contexte_d'utilisation"
"Notes_d'usage"
"Context_d'utilisation"
"Notes_d'utilisation"
"Attributs_d'événement_d'animation"
"Attributs_d'événement_du_document"
You can’t perform that action at this time.