Skip to content

Instantly share code, notes, and snippets.

View Luna-Klatzer's full-sized avatar
🏳️‍⚧️
Cherish growth ~ she/her

Luna Luna-Klatzer

🏳️‍⚧️
Cherish growth ~ she/her
View GitHub Profile
@Luna-Klatzer
Luna-Klatzer / insert-html-banner.py
Last active February 6, 2022 21:32
Python HTML Banner Insertion
""" Script to automatically insert a disclaimer html into each html page """
from html.parser import HTMLParser
from pathlib import Path
from typing import List
from glob import glob
BANNER_TO_INSERT: str = """
<div id="disclaimer-banner" style="display: flex; justify-content: center; background-color: white;">
<p style="padding: 0.5rem; font-style: italic; margin: 0;">
Educational, non-profit project created by students
@Luna-Klatzer
Luna-Klatzer / package.json
Last active June 13, 2022 08:19
Default Project Setup for Parcel
{
"name": "default_name",
"version": "0.0.1",
"description": "A default project setup to just have a basic local environment",
"keywords": [
"dummy"
],
"license": "GPL-3.0",
"author": "Luna Klatzer",
"engines": {
@Luna-Klatzer
Luna-Klatzer / deploy-gh-pages.yml
Last active June 13, 2022 08:35
Deploying a project using Parcel with the addition of a disclaimer banner
name: Deploy GH-Pages
on:
push:
branches: [ main, master ]
jobs:
build:
runs-on: ubuntu-latest
@Luna-Klatzer
Luna-Klatzer / README.md
Last active January 18, 2022 08:03
Setup Guide for Automatic Building and Deployment

Setup Guide for Automatic Building and Deployment

This Guide aims to explain the WMC "Standard" for deploying your site on GitHub, where it will stay online 24/7 under your own unique URL.

For that, we will use Github Pages and Github Actions, which are both integrated tools in GitHub everyone may use that has an account.

Content

{
"name": "default_name",
"version": "0.0.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "default_name",
"version": "0.0.1",
"license": "GPL-3.0",
@Luna-Klatzer
Luna-Klatzer / kipper-modules-proof-of-concept.ts
Last active June 21, 2022 09:39
Simple proof of concept for a possible implementation modules in Kipper, which would be usable in a Web API that supports running Kipper files like in the WASM API.
// --------------------------------
// file1.ts
// --------------------------------
// Kipper Built-ins
function __print__(msg: string): void { console.log(msg); }
// Import other Kipper modules
import * as __file2__ from "./file2";
@Luna-Klatzer
Luna-Klatzer / build-dotjs-templates.ts
Last active June 27, 2022 19:12
Simple script for buidling dot.js template files (`.jst`) and generating the js template functions.
import * as dot from 'dot';
import * as fs from "fs";
import * as rimraf from 'rimraf';
const source: string = `${__dirname }/templates`;
const destination: string = `${__dirname}/dot-build`;
// Generate destination files from source template files
(async () => {
// If the destination folder exists, remove it to ensure it does not contain old files
@Luna-Klatzer
Luna-Klatzer / runtime-types-proof-of-concept.js
Last active December 9, 2022 21:52
Runtime-types proof of concept for Kipper. This shows the possible implementation of runtime types, where you will be able to check the types against constant type identifiers and will be able to perform checks using the `match` operator.
/**
* Sample Script for showing the core functionality of how runtime types should work in Kipper.
*/
"use strict";
// @ts-ignore
var __kipperGlobalScope = typeof __kipperGlobalScope !== "undefined" ? __kipperGlobalScope : typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
// @ts-ignore
var __kipper = __kipperGlobalScope.__kipper = __kipperGlobalScope.__kipper || __kipper || {};
// The parent of all Kipper runtime types
@Luna-Klatzer
Luna-Klatzer / kipper-benchmark-sample.kip
Last active November 14, 2022 00:05
Sample script for a quick benchmark of parse and compile time of the Kipper Compiler v0.10.0-alpha.5
var x: num = 5;
def incr(val: num) -> void { x += val; }
def prn(val: num) -> void { print(val as str); }
/* Increment and print */
incr(5);
prn(x);
/* Increment and print */
@Luna-Klatzer
Luna-Klatzer / __init__.py
Last active February 18, 2024 14:33
Anki Plugin for auto-filling data in Anki cards using the Jisho.org API
# Jisho.org Support for Anki
import os, re, json, requests, urllib.request, urllib.parse
from aqt import gui_hooks
from aqt import mw
from aqt.qt import qconnect
from aqt.editor import Editor
from aqt.utils import showInfo
from anki.utils import stripHTML