Skip to content

Instantly share code, notes, and snippets.

View SphinxKnight's full-sized avatar

SphinxKnight SphinxKnight

View GitHub Profile

Keybase proof

I hereby claim:

  • I am SphinxKnight on github.
  • I am sphinx (https://keybase.io/sphinx) on keybase.
  • I have a public key whose fingerprint is AB48 D79C 4E6C 404E 10D3 A6D8 8E84 3087 4903 8C36

To claim this, I am signing this object:

'''
emulating doc status pages
'''
import urllib.request
import json
from datetime import datetime
PREFIX = 'https://developer.mozilla.org/en-US/docs/Web/'
SUFFIX = '$children?expand'
DATE_FORMAT = '%Y-%m-%dT%H:%M:%S'
@SphinxKnight
SphinxKnight / SnippetAPI
Created March 16, 2018 13:30
A snippet to generate a basic API data (no subfeatures)
"APICompatData":{
"prefix": "APICompat",
"body": [
"{",
" \"api\": {",
" \"$1\": {",
" \"__compat\": {",
" \"mdn_url\": \"https://developer.mozilla.org/docs/Web/API/$1\",",
" \"support\": {",
" \"webview_android\": {",
@SphinxKnight
SphinxKnight / manifest.json
Created June 5, 2018 21:26
ActiveHL WebExtension
{
"manifest_version": 2,
"name": "ActiveHL",
"version": "1.0",
"description": "Put the active tab in red.",
"permissions": ["theme","tabs"],
"background": {
"scripts": ["styling.js"]
}
}
@SphinxKnight
SphinxKnight / index.html
Last active January 12, 2019 08:53
WebAudio Bars
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Test Audio</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="main.css" />
</head>
<body>
@SphinxKnight
SphinxKnight / build_db.js
Last active February 18, 2019 07:13
MDN static scan
const os = require("os");
const fs = require("fs");
const { sep } = require("path");
const sqlite3 = require("sqlite3");
const dbName = "mdn_stats.db";
const dbPath = os.tmpdir() + sep + "scanMDNstats" + sep + dbName;
const cachePath = os.tmpdir() + sep + "scanMDNstats";
const recapFileName = "recap.json";
@SphinxKnight
SphinxKnight / client.js
Created March 18, 2019 17:29
WebAuthn tests -WIP-
function pkCcreate(){
var publicKey = {
challenge: new Uint8Array([10,32,47,4,13,3,37,11,13,47,18,46,6,51,11,27,13,25,42,25,19,36,35,0,17,46]),
rp: {
name: "Example CORP",
id : "localhost"
},
user: {
id: new Uint8Array(26),
@SphinxKnight
SphinxKnight / email20190508.txt
Last active February 19, 2020 07:12
Stumptown - l10n thoughts
Hello all,
Sorry for the delay*, thanks for the pointers to stumptown-experiment, I'm glad to see this idea coming to life :) I took some time to dig into the repo and will continue to do so before Whistler.
Some "structure" thoughts
As for localization, I'd think, one way to "prepare" for it would be to somehow create a "locales" directory with an "en-US" subdirectory in it. This would allow for some kind of basic pseudo-localization. I would somehow also prefer to have all of the prose"s" of a given section under the same directory.
Some "user stories" thoughts
As a new localizer I want to know "what there is to be done" so that I can contribute efficiently (ala Doc status page, I know they are not perfect but they are still a great tools :))
As a maintainer, I want to know which content needs updating so that localized content does not stale
@SphinxKnight
SphinxKnight / HTML.md
Created November 7, 2019 11:05
French "stumptown" content

title: "HTML: Hypertext Markup Language" mdn_url: /fr/docs/Web/HTML specifications: https://html.spec.whatwg.org/multipage/ recipe: landing-page related_content: /content/related_content/html.yaml link_lists:

  • title: Apprendre HTML pages:
  • "/content/learn/html/Introduction_to_HTML"
@SphinxKnight
SphinxKnight / advent_1.js
Last active December 7, 2019 20:35
Advent of code 2019
const fs = require("fs");
const dataFile = "input1.txt";
const assert = require("assert").strict;
function convertFuel(amount) {
return Math.trunc(amount / 3) - 2;
}
assert.equal(convertFuel(1969), 654);
assert.equal(convertFuel(100756), 33583);