This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Given an Obsidian markdown note named "YYYYwNN.md", | |
where YYYY is the year and NN is the week number, | |
e.g. "2024w07.md", this Dataview JS snippet will list all | |
the notes in the valut created between the Thursday of that week | |
and the Wednesday of the following week. | |
Include this code snippet in your weekly note template within a dataviewjs block: | |
```dataviewjs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import re | |
import os | |
import zipfile | |
def redact_names(html_filename, OUTPUT_DIR='.'): | |
## Load html file | |
with open(html_filename, 'r') as f: | |
txt = f.read() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A Python MESA implementation of the Minority Game (Challet and Zhang, 1997) | |
Author: Jaime Ruiz Serra | |
Date: Dec 2022 | |
""" | |
import mesa | |
import numpy as np | |
from scipy.stats import bernoulli |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Given exports from PaperSpan, Diigo, Pocket, format for import to Instapaper. | |
Run the script, browse to https://www.instapaper.com/user and select "Import from Instapaper CSV" | |
""" | |
import datetime | |
import csv | |
import re |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Based on @4rtemi5 's TF implementation, ported to PyTorch | |
https://www.rpisoni.dev/posts/cossim-convolution/ | |
""" | |
import torch | |
from torch import nn | |
import torch.nn.functional as F | |
class CosSimConv2D(nn.Module): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Tidy up files in Zettelkasten vault | |
# Ensure we are running this in the right directory | |
[[ "$(basename $PWD)" -eq "zettelkasten" ]] || exit 1 | |
# Delete empty files | |
find . -type f -size 0 -exec echo Removing empty file: {} \; -exec rm "{}" \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# * Converts citations: | |
# "[[Lastname2019a]]" into "\cite{Lastname2019a}" | |
# | |
# * Interprets code blocks with four back-ticks (````) as comments, | |
# and those with three back-ticks (```) as "lstlisting" environments. | |
# | |
# * Images: | |
# "![[Image Name.png]]" into "\figure (blablablabla)" |