Skip to content

Instantly share code, notes, and snippets.

View birtles's full-sized avatar

Brian Birtles birtles

View GitHub Profile
@birtles
birtles / return-promises.patch
Created February 16, 2018 07:08
Patch to return Promise objects from Animation playback methods
# HG changeset patch
# Parent 994a8d6eccbcdc6106794705bd77e3ac5f031be2
diff --git a/dom/animation/Animation.cpp b/dom/animation/Animation.cpp
--- a/dom/animation/Animation.cpp
+++ b/dom/animation/Animation.cpp
@@ -391,11 +391,11 @@ Animation::SetPlaybackRate(double aPlayb
}
// https://drafts.csswg.org/web-animations/#seamlessly-update-the-playback-rate
@birtles
birtles / web-ext submit.svg
Created March 20, 2018 01:29
web-ext submit dependencies
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!doctype html>
<meta charset=utf-8>
<title>Notes example</title>
<script src="https://unpkg.com/react@%5E16.5.0/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@%5E16.5.0/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/prop-types@%5E15.6/prop-types.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<style>
:root {
--yellow-background: hsl(54, 100%, 90.2%);
@birtles
birtles / opacity.html
Created January 30, 2019 00:59
Opacity test case
<!doctype html>
<meta charset=utf-8>
<style>
div {
width: 200px;
height: 200px;
background: orange;
}
</style>
<div id=div></div>
@birtles
birtles / misc-in-group.patch
Created December 2, 2020 08:08
Patch for applying misc labels to group headings
diff --git a/src/popup.ts b/src/popup.ts
index ca9d850..12b70da 100644
--- a/src/popup.ts
+++ b/src/popup.ts
@@ -1,4 +1,8 @@
-import { KanjiResult, NameTranslation } from '@birchill/hikibiki-data';
+import {
+ KanjiResult,
+ MiscType,
+ NameTranslation,
@birtles
birtles / misc-at-top.patch
Created December 2, 2020 08:20
Patch to display common misc labels at the top
diff --git a/src/popup.ts b/src/popup.ts
index ca9d850..1272482 100644
--- a/src/popup.ts
+++ b/src/popup.ts
@@ -449,6 +449,39 @@ function renderDefinitions(entry: WordResult, options: PopupOptions) {
if (entry.s.length === 1) {
definitionsDiv.append(renderSense(entry.s[0], options));
} else {
+ // Extract any misc labels that apply to the whole set of definitions
+ let commonMisc = entry.s[0].misc;
@birtles
birtles / TrustedMarkdown.astro
Last active December 14, 2023 06:16
Resolve relative image paths in Astro markdown files
---
import { getTrustedMarkdownProcessor } from '@utils/markdown';
export type Props = {
content: string;
path?: string;
};
const html = await (await getTrustedMarkdownProcessor()).process({
path: Astro.props.path,