Skip to content

Instantly share code, notes, and snippets.

View apple-phi's full-sized avatar
🍏
Making apple crumble

Lucas apple-phi

🍏
Making apple crumble
View GitHub Profile
@apple-phi
apple-phi / lumapi.pyi
Created June 12, 2025 18:58
Python typehint stubs for Lumerical's lumapi.py, auto-generated from the docs
This file has been truncated, but you can view the full file.
# This file is auto-generated from the lumapi documentation.
from _typeshed import Incomplete
from collections.abc import Generator
from contextlib import contextmanager
from ctypes import Structure, Union
from typing import Any, Optional, List, Tuple, Dict, overload
import types
import numpy as np
@apple-phi
apple-phi / sp-dl.user.js
Last active June 21, 2024 10:09
Add download as zip to Sharepoint tables
// ==UserScript==
// @name SharePoint list download link
// @namespace http://tampermonkey.net/
// @version 0.1.3
// @description Add download link to SharePoint list items that contain links to files
// @author apple-phi
// @match *://*/*.aspx*
// @grant none
// @license MIT; https://opensource.org/licenses/MIT
// @run-at document-start
@apple-phi
apple-phi / data.toml
Created June 18, 2024 16:32
Part II module selection heuristic
[Area.Mechanical]
min = 4
required = [{core = 4}]
core = """4A2 Computational Fluid Dynamics
4A3 Turbomachinery I
4A7 Aircraft Aerodynamics and Design
4A9 Molecular Thermodynamics
4A10 Flow Instability
4A12 Turbulence and Vortex Dynamics
4A13 Combustion and Engines
@apple-phi
apple-phi / latex-suite.snippets.js
Last active November 3, 2024 15:50
My snippets for Obsidian Latex Suite
[
// New
{ trigger: "of", replacement: "\circ ", options: "mA" },
{ trigger: "aint", replacement: "\\int_{\\mathcal{X}}$0\\,\\mathrm{d}x $1", description: "Integration over alphabet", options: "mA" },
{ trigger: "rint", replacement: "\\int_{\\mathbb{R}}$0\\,\\mathrm{d}x $1", description: "Integration over reals", options: "mA" },
{ trigger: /([A-Z])int/, replacement: (match) => `\\int_{\${0:${match[1]}}}$1\\,\\mathrm{d}${match[1].toLowerCase()} $2`, options: "rmA", description: "Integration over a domain" },
{ trigger: /(.)([nijkXYZ])\2/, replacement: "[[0]]_{[[1]]$0}$1", options: "rmA", description: "Subscripts for n, i, j, k" },
{ trigger: "H_{2}(", replacement: "\\operatorname{\\mathcal{H}_{2}}(${0:p})$1", options: "mA" },
{ trigger: "dkl", replacement: "D_{KL}[${0:P}\\parallel ${1:Q}]", options: "mA" },
{ trigger: "electron", replacement: "$\\mathrm{e}^{-}$ ", options: "tA" },
@apple-phi
apple-phi / JCE-Harvard.csl
Last active January 20, 2024 17:10
Zotero style for the John Carpenter Essay competition
<?xml version="1.0" encoding="utf-8"?>
<!-- Modified from http://www.zotero.org/styles/harvard-cite-them-right by Lucas Ng (2021) -->
<!-- This file attempts to follow the guidelines in the John Carpenter Essay Guidance for June 2021 -->
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-GB">
<info>
<title>John Carpenter Essay Competition - Harvard</title>
<id>http://www.zotero.org/styles/harvard-cite-them-right-modified</id>
<link href="http://www.zotero.org/styles/harvard-cite-them-right" rel="self"/>
<link href="http://www.zotero.org/styles/harvard-university-of-greenwich" rel="template"/>
<link href="http://www.citethemrightonline.com/" rel="documentation"/>
@apple-phi
apple-phi / neutralino.py
Created August 17, 2021 15:47
Neutralinojs plugin for Eel
# MIT License
# Copyright (c) 2021 Lucas Ng
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions: