Skip to content

Instantly share code, notes, and snippets.

@belkarx
belkarx / line_timestamp_journal.lua
Created September 20, 2024 19:05
create timestamps of every new line when journalling (for tracking the development of symptoms over time for example, or a low friction timestamped journal)
-- plugin/finished_line_logger.lua
local journal_file = os.getenv("HOME") .. "/nvim-journal.txt"
local function append_to_journal(line, timestamp)
local file = io.open(journal_file, "a")
if file then
file:write(string.format("%s|%s\n", line, timestamp))
file:close()
else
print("Error: Could not open journal file")
@belkarx
belkarx / gist:39dcc2256ce777d7f5022875b92a34e3
Created August 19, 2024 06:01
international search results
Here's a summary of the snippets for each country in bullet points:
English:
Tea polyphenols can enhance the anticancer activity of chemotherapy drugs
Chemotherapy drugs can lower blood cell count, increasing risk of anemia and neutropenia
Side effects of chemotherapy include gastrointestinal issues
Research is being done on preventing "chemo brain"
Some chemotherapy drugs may increase hearing loss in adults
Immunotherapy is becoming more widely used to treat cancer
Marijuana may affect cancer symptoms and treatment
@belkarx
belkarx / open_llm.py
Created July 1, 2024 21:12
anthropic web interface too slow? pop up a little window for quick queries, as a google replacement
import tkinter as tk
#import pyperclip
import requests
import os
import json
def submit_text(event=None):
text = text_var.get()
response = requests.post(
@belkarx
belkarx / README.md
Created May 6, 2024 23:26
this is a dynamic page that'll probably have resources or challenges or something
@belkarx
belkarx / script_name.sh
Created May 2, 2024 22:51
open note on beanote
#!/bin/bash
###
# add an .xbindkeys entry like so:
# "sleep .1 && xdotool click 3 && sh /home/script_name.sh"
# alt+f
###
# Function to handle the key combination
@belkarx
belkarx / blackout.js
Created May 2, 2024 21:27
black out words that stress you out
// ==UserScript==
// @name Text Blackout (Efficient)
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Efficiently blacks out text segments from the array "a" on every page
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
import sys
from anthropic import Client
def main():
# Get the API key from an environment variable or secret management system
client = Client()
# Get the input string from the command-line arguments
input_string = " ".join(sys.argv[1:])
print("got " + input_string)
@belkarx
belkarx / index.md
Last active April 18, 2024 22:45
perhaps i will make a lil website

about me:

  • in that stage of life where i question my motivations for everything
  • studying the structure of [my] consciousness
  • trying to be better
  • learning more math and physics. it's never enough
  • ml research, as the desire strikes me
  • trying to be compensated for my value add to the world
  • fucking around, finding out

\

@belkarx
belkarx / script.js
Last active April 11, 2024 20:21
greasemonkey script to autoselect all elements that follow a pattern on a page!
// ==UserScript==
// @name Anthropic Caller for Google Scholar
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Calls Anthropic API and extracts relevant data from Google Scholar pages
// @author Your Name
// @match *://scholar.google.com/*
// @grant GM_xmlhttpRequest
// ==/UserScript==
@belkarx
belkarx / xorgrant writeup.md
Last active April 6, 2024 14:57
xorgrant writeup

fun chall! my first thought was to

  • find the font -> do deterministic search for the bitarrays

i couldn't find the font, missed that the beginning of the b64 had the font set, and then thought:

  • find a grid size that segmented all the characters into equal rectangles, then just manually label stuff and compare rectangles

As it turns out, the lines were not consistent sizes, so i considered:

  • doing a flow algorithm to find all connected pixels so i could identify characters