Skip to content

Instantly share code, notes, and snippets.

View agoose77's full-sized avatar
🏠
Working from home

Angus Hollands agoose77

🏠
Working from home
View GitHub Profile
{
"allowCDN": "awaiting-decision",
"requirejsCDN": "https://cdn.jsdelivr.net/npm/",
"urls": [],
"showIconInLauncher": true,
"plugins": [
"import {\n JupyterFrontEnd,\n JupyterFrontEndPlugin,\n} from \'@jupyterlab/application\';\nimport { ITranslator, nullTranslator } from \'@jupyterlab/translation\';\nimport { FileEditor, IEditorTracker } from \'@jupyterlab/fileeditor\';\nimport { Notebook, INotebookTracker } from \'@jupyterlab/notebook\';\nimport { ICommandPalette } from \'@jupyterlab/apputils\'\n\n/**\n * This is an example hello world plugin.\n * Open Command Palette with Ctrl+Shift+C\n * (Command+Shift+C on Mac) and select\n * \"Load Current File as Extension\"\n */\nnamespace CommandIDs {\n export const toggleComment = \'codemirror:toggle-comment\';\n}\n\n\nfunction toggleNotebook(widget: Notebook) {\n const cell = widget.content.activeCell;\n if (cell?.model.type !== \'code\') {\n return;\n }\n\n const editor = cell.editor as CodeMirrorEditor;\n edi
import {
JupyterFrontEnd,
JupyterFrontEndPlugin,
} from '@jupyterlab/application';
import { ITranslator, nullTranslator } from '@jupyterlab/translation';
import { FileEditor, IEditorTracker } from '@jupyterlab/fileeditor';
import { Notebook, INotebookTracker } from '@jupyterlab/notebook';
import { ICommandPalette } from '@jupyterlab/apputils'
/**
@agoose77
agoose77 / gha-sphinx-link-check.py
Created January 5, 2023 22:08
GitHub Actions script for annotating results of Sphinx linkcheck
import jax
from jax import numpy as jnp
class RegularArray:
def __init__(self, content, size):
self.content = content
self.size = size
def __len__(self):
def validate_items(items):
state = validator_wait_for_array
for item in prepared:
next_state = state(item)
if next_state is not None:
state = next_state
return tuple(prepared)
def validator_reject_array(item):
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from sphinx.transforms import SphinxTransform
import sphinx.environment.collectors.toctree as toctree_collector
from sphinx import addnodes
from docutils import nodes
from typing import Any, Dict, List, Set, Tuple, Type, TypeVar, cast
from docutils import nodes
from docutils.nodes import Element, Node
@agoose77
agoose77 / emoji.py
Created July 21, 2022 11:56
Sphinx extension to render emojis in XeLaTeX using emojicdn
import requests
import pathlib
import os
import re
from sphinx.util import logging
logger = logging.getLogger(__name__)
def emoji_to_identifier(emoji):
@agoose77
agoose77 / emoji-xelatex.sty
Created July 21, 2022 11:55
Emojis using a BW vector font in XeLaTeX
% Support emoji
\usepackage{fontspec}
\newfontfamily{\emojifont}{Noto Emoji}
\usepackage[Latin, Greek, Dingbats, TransportAndMapSymbols, MiscellaneousSymbolsAndPictographs]{ucharclasses}
\setTransitionsFor{MiscellaneousSymbolsAndPictographs}{\begingroup\emojifont}{\endgroup}
\setTransitionsFor{TransportAndMapSymbols}{\begingroup\emojifont}{\endgroup}
\setTransitionsFor{Dingbats}{\begingroup\emojifont}{\endgroup}
// ==UserScript==
// @name Hide Adverts
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.amazon.co.jp/*
// @match https://smile.amazon.co.uk/*
// @match https://www.amazon.co.uk/*
// @match https://smile.amazon.com/*