This file contains 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
// ==UserScript== | |
// @name Arxiv PDF Title Updater for Hypothesis Pages | |
// @namespace http://tampermonkey.net/ | |
// @version 1.2 | |
// @description Update Arxiv PDF links titles on Hypothesis pages | |
// @author David Bieber + GPT-4 | |
// @match *://*.hypothes.is/* | |
// @grant GM_xmlhttpRequest | |
// ==/UserScript== |
This file contains 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 -S python3 -m fire | |
def hello(name): | |
return f'Hello {name}!' |
This file contains 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
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
function getPage(page) { | |
// returns the uid of a specific page in your graph. | |
// _page_: the title of the page. | |
let results = window.roamAlphaAPI.q(` | |
[:find ?uid | |
:in $ ?title |
This file contains 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
"""Automatic distraction detection. Work in progress. | |
Usage: | |
python detect.py main | |
""" | |
import fire | |
import subprocess | |
import plyvel | |
import re |
This file contains 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
let container = "Tree of knowledge"; | |
let tag = "zettel"; | |
let ancestorrule=`[ | |
[(ancestor ?child ?parent) | |
[?parent :block/children ?child]] | |
[(ancestor ?child ?a) | |
[?parent :block/children ?child] | |
(ancestor ?parent ?a)] | |
]`; |
This file contains 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
"""Performs automatic speed edits to audio books. | |
Example usage: | |
Assuming you have an audiobook book.aax on your Desktop: | |
1. Convert it to wav: | |
ffmpeg -i ~/Desktop/book.aax ~/Desktop/book.wav | |
2. Adjust the speed: |
This file contains 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
function onOpen() { | |
var ui = SpreadsheetApp.getUi(); | |
ui.createMenu('Activity Log') | |
.addItem('Archive Past Events', 'archivePastEvents') | |
.addToUi(); | |
} | |
function archivePastEvents() { | |
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = spreadsheet.getSheetByName("Activities"); |
This file contains 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
function getColumnIndexes(columns) { | |
// Returns a map from column name to column index. | |
var container = {}; | |
for (var i = 0; i < columns.length; i++) { | |
var value = columns[i]; | |
container[value] = i; | |
} | |
return container; | |
} |
This file contains 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
// Computer assisted snake! | |
// Paste this into the JS console at http://dskang.com/snake/ to play and win! | |
function getX() { | |
var head = gSnake.getHead(); | |
var x = head.x / 20; | |
return x; | |
} | |
function getY() { |
This file contains 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 selenium import webdriver | |
driver = webdriver.Firefox() | |
driver.set_window_size(800, 600) | |
driver.set_window_position(0, 0) | |
driver.get("https://images.google.com") | |
searchbar = driver.find_elements_by_css_selector("#lst-ib")[0] | |
searchbar.send_keys("cute kittens") | |
searchbar.submit() |
NewerOlder