Skip to content

Instantly share code, notes, and snippets.

View sneakers-the-rat's full-sized avatar

Jonny Saunders sneakers-the-rat

View GitHub Profile
@sneakers-the-rat
sneakers-the-rat / snake.js
Last active June 27, 2024 07:55
Snake for onemillioncheckboxes.com
// Snake interface for onemillioncheckboxes.com
// with love from jonny
var direction;
var current_box;
var check_time = +new Date();
var scroll_debounce = false;
const SPACE_MULTIPLIER = 3;
const spacing = 35;
@sneakers-the-rat
sneakers-the-rat / textual_dirchooser.py
Created March 29, 2024 22:12
Choose multiple directories with Textual
from pathlib import Path
from typing import Iterable, List
from textual.app import App, ComposeResult
from textual.widgets import DirectoryTree, Header
from textual import events
from rich.text import Text, TextType
from textual.containers import Container
class MultiSelectDirectoryTree(DirectoryTree):
@sneakers-the-rat
sneakers-the-rat / dirchooser.py
Created March 29, 2024 20:31
Select multiple directories with PySide6
from pathlib import Path
from typing import Optional, List
from PySide6.QtWidgets import (
QApplication,
QFileDialog,
QListView,
QAbstractItemView,
QTreeView,
QFileSystemModel
@sneakers-the-rat
sneakers-the-rat / linkml.html
Created March 9, 2024 06:58
LinkML Pydanticgen in the browser with Pyodide
<!doctype html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/pyodide/v0.25.0/full/pyodide.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@highlightjs/[email protected]/styles/default.min.css">
<script src="https://unpkg.com/@highlightjs/[email protected]/highlight.min.js"></script>
<!-- and it's easy to individually load additional languages -->
<script src="https://unpkg.com/@highlightjs/[email protected]/languages/python.min.js"></script>
<script src="https://unpkg.com/@highlightjs/[email protected]/languages/yaml.min.js"></script>
@sneakers-the-rat
sneakers-the-rat / fly.html
Created March 20, 2023 22:45
paper crane that doesn't let you close it
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>.</title>
</head>
<body bgcolor="ffffff">
<font size="1">
<pre> |b
This is fun... ||
||,
@sneakers-the-rat
sneakers-the-rat / check_citations.html
Created March 1, 2023 00:15
check citations on crossref
<!DOCTYPE html>
<html lang="en-US">
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<div class="query">
<h2>Query Crossref Why Dont Ya</h2>
@sneakers-the-rat
sneakers-the-rat / phd-stipends_22-09-23T20-51-04.csv
Created September 24, 2022 04:01
A Scrape of phdstipends.com!
We can't make this file beautiful and searchable because it's too large.
University,Department,Overall Pay,Academic Year,Program Year,Comments
,Electrical Engineering,"$23,700",2021-2022,1st,
Iowa State University (ISU),Electrical Engineering,"$23,700",2021-2022,1st,
Drexel University (DU),Computer Science,"$32,000",2021-2022,5th,
Case Western Reserve University,Macromolecular Science and Engineering/Phd,"$27,600",2022-2023,3rd,
University of Missouri (MU),Computer Science,"$30,000",2022-2023,1st,
Emory University,French,,2022-2023,1st,
Rutgers the State University of New Jersey - New Brunswick,French,,2022-2023,1st,
Rutgers the State University of New Jersey - New Brunswick,comparative literature,,2022-2023,1st,
Rutgers the State University of New Jersey - New Brunswick,French,,2022-2023,1st,
@sneakers-the-rat
sneakers-the-rat / pie_plot.R
Created August 23, 2022 00:20
pie charts in ggplot2
library(ggplot2)
data <- data.frame(
months=c("jan", 'feb', 'mar', 'apr', 'may', 'june', 'july', 'august', 'sept', 'oct', 'nov', 'dec'),
days=c(31,28,31,30,31,30,31,31,30,31,30,31),
values=seq(12)
)
g.pie <- ggplot(data, aes(x='', y=days, fill=values)) +
geom_col()+
@sneakers-the-rat
sneakers-the-rat / wowchemy.js
Created March 3, 2022 22:30
Patched wowchemy.js
/*************************************************
* Wowchemy
* https://github.com/wowchemy/wowchemy-hugo-themes
*
* Core JS functions and initialization.
**************************************************/
import mediumZoom from './_vendor/medium-zoom.esm';
import {hugoEnvironment, codeHighlighting, searchEnabled} from '@params';
import {scrollParentToChild} from './wowchemy-utils';
@sneakers-the-rat
sneakers-the-rat / multifilter.js
Created March 3, 2022 22:19
Override Academic Theme Filter
function multiFilter(e){
// get isotope instance and filter buttons
let iso = Isotope.data('.projects-container');
let filterButtons = document.querySelectorAll('.project-filters a');
// iterate through buttons...
filterButtons.forEach((button) => {
// remove existing event listeners