Skip to content

Instantly share code, notes, and snippets.

View charmoniumQ's full-sized avatar
:shipit:
dabbing on the haters

Sam Grayson charmoniumQ

:shipit:
dabbing on the haters
View GitHub Profile
@charmoniumQ
charmoniumQ / a_gravity_problem_numerical.ipynb
Last active February 1, 2024 21:57
Evan's dumb gravity question
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@charmoniumQ
charmoniumQ / gist:0f04ef83cb687f49edb1e1cb3910c182
Created September 26, 2023 19:24
Partially pooled linear regression when x[0] == 0 for all instances where x[1] == "specific-class"
import pathlib
import datetime
import pymc
import arviz
import runner
random_seed = 0
cache = pathlib.Path(".cache")
df = runner.get_results()
@charmoniumQ
charmoniumQ / flake.lock
Last active September 23, 2023 01:06
Bash crashes in Valgrind when LC_CTYPE is set to C.UTF-8
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1695227375,
"narHash": "sha256-76WTkeCu3npPZDkay2hB2Dj3cOuCiF0P41dbmXWUKtA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fe977679240ac2027b151ecca1bc6ce808c2e8af",
"type": "github"

This is an index of Espernato resources on the web. I will eventually move this into a Wiki space somewhere. Within each sections, the links are approximately ordered by usefulness to me. This is in English because it is targetted towards beginners. When Esperanto words are in the title of a resource, the translation is in parentheses.

Courses

import re, pathlib, collections, shlex
shared_paths = {}
for proc_dir in pathlib.Path("/proc").iterdir():
if re.match("[0-9]+", proc_dir.name) and (proc_dir / "maps").exists():
try:
map_text = (proc_dir / "maps").read_text()
except PermissionError:
pass
else:
# yay, the read_text succeeded
#!/usr/bin/env python
import requests
import lxml.etree
import tqdm
import math
import heapq
import numpy
import random
xml_text = requests.get("http://www.remush.be/tezauro/PIV.xml").content

Example usage:

journalctl --unit=NetworkManager --lines=500 | cut --bytes=72- | python log_markov_chain.py

The cut takes off the timestamp, so the logs actually contain verbatim repitions of some lines [A, B, C, A, ...]

// Sort items by publication venue in Zotero
// Highlight a set of items first.
const items = Zotero.getActiveZoteroPane().getSelectedItems();
itemsByPub = {};
for (const i in items) {
itemInfo = items[i].toJSON();
publication = itemInfo.publicationTitle;
if (!(publication in itemsByPub)) {
itemsByPub[publication] = [];
}
@charmoniumQ
charmoniumQ / style.css
Created April 30, 2022 13:37
View Google Calender availability without revealing event names
html > body > div > div > div > div > div > div > div > div > div > div > div > div > div > div > div > div > div > div > span > span {
display: none;
}
html > body > div > div > div > div > div > div > div > div > div > div > div > div > div > div > div > div > div > span > span > html-blob {
display: none;
}
SPDX Identifier Trove Classifier
AFL-1.1 License :: OSI Approved :: Academic Free License (AFL)
AFL-1.2 License :: OSI Approved :: Academic Free License (AFL)
AFL-2.0 License :: OSI Approved :: Academic Free License (AFL)
AFL-2.1 License :: OSI Approved :: Academic Free License (AFL)
AFL-3.0 License :: OSI Approved :: Academic Free License (AFL)
Apache-1.1 License :: OSI Approved :: Apache Software License
Apache-1.2 License :: OSI Approved :: Apache Software License
Apache-2.0 License :: OSI Approved :: Apache Software License
APSL-1.0 License :: OSI Approved :: Apple Public Source License