This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Any copyright is dedicated to the Public Domain. | |
# http://creativecommons.org/publicdomain/zero/1.0/ | |
from fluent.migrate.helpers import transforms_from | |
from fluent.migrate.transforms import TransformPattern | |
import fluent.syntax.ast as FTL | |
class REPLACE_TOTAL(TransformPattern): | |
def visit_TextElement(self, node): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests | |
base_url = "https://product-details.mozilla.org/1.0/l10n/" | |
changesets = {} | |
for version in range(68, 128): | |
version_str = f"{version}.0" | |
for build_number in range(1, 6): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
""" | |
The script looks for TTF fonts in FontAwesome folder. It doesn't use WOFF2 | |
directly, because glyph names seem to be unreliable. | |
Optimized fonts are saved in `/pontoon/base/static/fonts/` as WOFF2. | |
The list of possible icons is done searching for `fa-*` in specific files (HTML, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
import glob | |
import json | |
# Find all .json files in logs/ | |
json_files = glob.glob("logs/*.json") | |
json_files.sort() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from urllib.request import urlopen | |
string_ids = [ | |
"browser/browser/newtab/asrouter.ftl:device-migration-fxa-spotlight-sync-body", | |
"browser/browser/newtab/asrouter.ftl:device-migration-fxa-spotlight-sync-header", | |
"browser/browser/newtab/asrouter.ftl:device-migration-fxa-spotlight-sync-primary-button", | |
] | |
locales = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import json | |
import re | |
import sys | |
from urllib.parse import quote as urlquote | |
from urllib.request import urlopen | |
def main(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Levenshtein | |
from rapidfuzz.distance import Indel | |
sentence_pairs = ( | |
("The sky is blue.", "It looks like rain."), | |
("I love reading books.", "My favorite genre is fantasy."), | |
("She enjoys playing piano.", "He prefers the guitar."), | |
("Coffee wakes me up.", "Tea relaxes me."), | |
("We are going to the park.", "They are staying home."), | |
("The dog barked loudly.", "The cat quietly meowed."), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sys | |
if len(sys.argv) == 1: | |
sys.exit("Provide the log file as an argument") | |
ips = {} | |
filter = re.compile(r"fwd=\"([\d.]+)\"") | |
threshold = 10 | |
# Copy from Heroku settings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from glob import glob | |
import csv | |
import os | |
import re | |
import sys | |
# Pass a path as an argument, the script will go through all .csv files included. | |
if len(sys.argv) < 2: | |
sys.exit("Missing path argument") | |
path = os.path.abspath(sys.argv[1]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import datetime | |
import json | |
import urllib.parse as url_parse | |
import urllib.request as url_request | |
from collections import defaultdict | |
api_token = "TOKEN" |