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 / 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/cdn-assets@11.9.0/styles/default.min.css">
<script src="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/highlight.min.js"></script>
<!-- and it's easy to individually load additional languages -->
<script src="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/languages/python.min.js"></script>
<script src="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/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
@sneakers-the-rat
sneakers-the-rat / e_hashs.json
Last active February 18, 2022 15:54
Elsevier PDF "hashes"
[
"FCi27mtaKod38ztmGndn-y8NNz.r.lt6SndqGztz_ztr-ngqQm9aMo9eOnMeJntuNntu",
"D2ei2mgqJz9b-m.mGmPqRyLNNnwmOlt7.ywiGmt-Kndr9otqRywv8o9ePmtiNmd2Sn92Tma",
"6U7vcmPuOn9uLnMaGyM7-nLNNntv9lt6RmtaGmweOyMmJnMmSmgmOo9eOnM6LnMaRmM-Tma",
"lXLf8owyQztiMzwqGnMz7zcNNotb7lwf.m9qGzt6Km.qMngqLndqLo9eOotaNm96Mmt6Tma",
"FCi27y9qOnd-Ny96GmPmOmcNNzwf-lwj-m9mGztz7ytaMnM78n9v-o9ePmM6Rm9-Qn9eTma",
"XlEDumMz7nM7-m9iGogmRmLNNyt_8lwiKz9eGm9-Pm.v7ztiLztz_o9eOnMeQnd-Sodm",
"lXLf8yt-JywmNmPeGm9n9n8NNzgn.lt_8zwqGogz7zgn7zt6SyPr-o9eOnM6Pot2Mn9qTma",
"FCi27zgf8mdqMmMeGnMmMy8NNz9eQlweNy.eGmMiMm96Qmgr9nMb-o9ePmtuRmt6JotmTma",
"FCi27nwmKnMeSodeGm.z.y8NNntz.lt-PywmGy9__ngqQmtiPmtb7o9ePmteJotyJoduTma",