Skip to content

Instantly share code, notes, and snippets.

@riceissa
riceissa / ublock-origin-substack.txt
Last active March 6, 2024 03:49
uBlock Origin filters for Substack and Substack-based websites
! Block annoying Substack stuff
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##.subscribe-dialog
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##.subscribe-dialog-scroll-modal-scroll-capture
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##[class*=".frontend-components-SubscribePrompt-module__subscribeDialog--"]
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##[class*=".frontend-components-SubscribePrompt-module__background--"]
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##.post-end-cta-full
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##.show-subscribe.subscription-widget
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##.topbar-content
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benland
@riceissa
riceissa / anki_algorithm.py
Last active December 15, 2023 09:36
my current understanding of Anki's spacing algorithm
"""
This is my understanding of the Anki scheduling algorithm, which I mostly
got from watching https://www.youtube.com/watch?v=lz60qTP2Gx0
and https://www.youtube.com/watch?v=1XaJjbCSXT0
and from reading
https://faqs.ankiweb.net/what-spaced-repetition-algorithm.html
There is also https://github.com/dae/anki/blob/master/anki/sched.py but I find
it really hard to understand.
Things I don't bother to implement here: the random fudge factor (that Anki
@riceissa
riceissa / vim-keys.txt
Last active November 1, 2023 12:24
Vim keys table
Legend: 'n' - not used in stock Vim
'y' - used in stock Vim
's' - synonym for something in stock Vim
'c' - key that continues, i.e. waits for another key; if 'showcmd' is
set, these are generally the cases where partial commands appear
on the status bar
The table assumes 'insertmode' and 'allowrevins' are not set.
See also <http://vim.wikia.com/wiki/Unused_keys>.
#!/usr/bin/env python3
import requests
query = """
{
posts(input: {
terms: {
view: "top"
limit: 50
@riceissa
riceissa / eliezer_non_sequence_posts.csv
Last active May 25, 2022 16:30
Eliezer Yudkowsky's non-sequence posts on LessWrong
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 4 columns, instead of 3. in line 7.
postedAt,baseScore,title,pageUrl
2018-12-12T01:40:13.298Z,71,Should ethicists be inside or outside a profession?,https://www.lesswrong.com/posts/LRKXuxLrnxx3nSESv/should-ethicists-be-inside-or-outside-a-profession
2018-12-07T22:24:17.072Z,82,Transhumanists Don't Need Special Dispositions,https://www.lesswrong.com/posts/cq4DsXzGRXJBmYuyB/transhumanists-don-t-need-special-dispositions
2018-12-05T20:12:13.114Z,86,Transhumanism as Simplified Humanism,https://www.lesswrong.com/posts/Aud7CL7uhz55KL8jG/transhumanism-as-simplified-humanism
2018-11-16T23:06:29.506Z,115,Is Clickbait Destroying Our General Intelligence?,https://www.lesswrong.com/posts/YicoiQurNBxSp7a65/is-clickbait-destroying-our-general-intelligence
2018-10-28T20:09:32.056Z,108,On Doing the Improbable,https://www.lesswrong.com/posts/st7DiQP23YQSxumCt/on-doing-the-improbable
2018-10-04T00:38:58.795Z,150,The Rocket Alignment Problem,https://www.lesswrong.com/posts/Gg9a4y8reWKtLe3Tn/the-rocket-alignment-problem
2018-05-31T21:28:19.354Z,190,Toolbox-thinkin
@riceissa
riceissa / dump.php
Created December 20, 2019 00:36
testing mysql regex via php
<pre>
<?php
include_once("backend/globalVariables/passwordFile.inc");
$queriesList = array(
'select "Ought" regexp ?' => 1,
'select "Forethought" regexp ?' => 0,
'select "Forethought|Ought" regexp ?' => 1,
'select "Open Phil|Ought" regexp ?' => 1,
'select "Open Phil|Ought|MIRI" regexp ?' => 1,
'select "Open Phil|ForethOught|MIRI" regexp ?' => 0,
@riceissa
riceissa / .gitignore
Last active November 3, 2021 06:06
LessWrong analytics post
post.html
rolling-pageviews.png
rolling-sessions.png
@riceissa
riceissa / LICENSE
Last active April 7, 2021 14:50
for pandoc; like -M links-as-notes:true, but better
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
buyers = [3.25 - 0.25*n for n in range(0, 11)]
sellers = [3.25 - 0.25*n for n in range(0, 11)]
price_deltas = [0.01 * x for x in range(0, 1000)]
trading_prices = []
@riceissa
riceissa / quine.py
Last active September 24, 2020 07:18
old quine from 2018-04-23
def defined(v):
return "v = \"" + v.replace("\\", "\\\\").replace("\"", "\\\"").replace("\n", "\\n") + "\"\n\nprint(v)\n\nprint(defined(v))"
v = "def defined(v):\n return \"v = \\\"\" + v.replace(\"\\\\\", \"\\\\\\\\\").replace(\"\\\"\", \"\\\\\\\"\").replace(\"\\n\", \"\\\\n\") + \"\\\"\\n\\nprint(v)\\n\\nprint(defined(v))\"\n"
print(v)
print(defined(v))