Skip to content

Instantly share code, notes, and snippets.

@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
@belkarx
belkarx / assistant.py
Created April 1, 2024 02:53
simplest possible assistant ever (getting this right is incredibly hard)
from openai import OpenAI
import pyttsx3
import sounddevice as sd
import numpy as np
import io
from scipy.io.wavfile import write
from threading import Thread
import os
import sys
import queue
@belkarx
belkarx / free_food_restaurants.py
Created April 1, 2024 02:37
find restaurants with free food near you
def find_restaurants(latitude, longitude, radius=5000): #
Radius in meters
# Overpass query
overpass_url = "http://overpass-api.de/api/interpreter"
overpass_query = f"""
[out:json];
(
node["amenity"="restaurant"](around:{radius},{latitud
e},{longitude});
@belkarx
belkarx / attention_test.py
Created December 3, 2023 08:33
OSS Impl. of Attention Test
import pygame
import time
import random
pygame.init()
screen = pygame.display.set_mode((800, 600))
black = (0, 0, 0)
white = (255, 255, 255)
font = pygame.font.Font(None, 72)
@belkarx
belkarx / write_out_code.py
Created December 3, 2023 08:33
Write out code character by character
IFS=''
character=''
sleep 5
while read -n1 -r character; do
if [[ $character == " " ]]; then
xdotool key "space"
sleep .01
elif [[ $character == "\\" ]]; then
read -n1 -r character
if [[ $character == "n" ]]; then