Skip to content

Instantly share code, notes, and snippets.

View compwron's full-sized avatar
💭
Hello world

compwron compwron

💭
Hello world
View GitHub Profile
// Paste this into the Firefox console on https://production.tuple.app/profile/usage
// It scrapes all pages and downloads a CSV file.
(async () => {
const allRows = [];
const totalPages = 47; // from pagination: Last » links to page=47
const TIMEOUT_MS = 10000;
const DELAY_MS = 1000;
let consecutiveEmpty = 0;
@compwron
compwron / github-critique.md
Last active April 24, 2026 13:27
CASA .github files critique

.github Critique

Bugs / Broken

1. autoapproval.yml — references a defunct bot dependabot-preview was shut down years ago; the real bot is just dependabot[bot]. This file does nothing and should be updated or deleted.

2. Broken Slack URL in every issue template All six templates have https:https://join.slack.com/... — the double-protocol typo means the link is dead. Affects bug_report.md, feature_request.md, problem_validation.md, flaky_test.md, chore.md, documentation.md.

namespace :acts_as_paranoid do
desc "Verify that all models using acts_as_paranoid have scopes on their unique indexes and validations"
task lint: :environment do
if Rails.env.test?
currently_probably_buggy_classes_ignored = %w[
# too many things, redacted
]
Zeitwerk::Loader.eager_load_all
errors = []
allows_multiple_deleted = "(deleted_at IS NULL)"
#!/user/bin/env ruby
puts "hi"
my_variable = "hi"
puts my_variable
x = 1
puts x
puts x + 2
names = ["name", "naaaame"]
puts names
data = { name: "name" }
@compwron
compwron / tinytaste.js
Created February 16, 2022 19:05
skillz for tiny taste
1 + 1
console.log("hello")
myFunctionName = () => {console.log("hi")}
myFunctionName()
myFunctionName2 = (x) { return x + 1 }
myFunctionName2(100)
document.body.style.backgroundColor = "red"
window.location.href
@compwron
compwron / LW_draft.txt
Created September 29, 2020 05:47
LessWrong codebase post draft
Notes for a possible blog post about https://github.com/LessWrong2/Lesswrong2 by Oliver Habryka or whoever
I may also use or publish some part of my notes
The codebase has two big tech debts for historical reasons: https://www.mongodb.com/ and https://www.meteor.com/
Typescript is good and helps a lot to make a sturdy codebase. It has also been an essential part of moving away from meteor.
http://vulcanjs.org/ is built on top of meteor, and in fact it helps LW move away from meteor, because it’s an abstraction layer over meteor. Meteor relies on sockets for communication, abstracted via a https://graphql.org/ layer.
@compwron
compwron / slave_in_software_considered_harmful.md
Created June 10, 2020 17:12
slave_in_software_considered_harmful.md

Background

In the world of software development / computer science, there is a technical term "slave" which should be abandoned. This post is intended to be a list of software tools which use "slave" or which have gone through a rename process away from using the word "slave".

More discussion/summary or this topic on Wikipedia

Definitions

@compwron
compwron / live-coding.py
Last active May 21, 2020 15:54
my live-coding answer to some hackerrank problem as I was demoing tech interviewing to a mentee
input = [5,
'Harry',
37.21,
'Berry',
37.21,
'Tina',
37.2,
'Akriti',
41,
'Harsh',
@compwron
compwron / query-counter.py
Created May 8, 2020 22:46
query-counter.py
# USAGE:
# def test_foo:
# stmts = []
# def catch_queries(conn, cursor, statement, a, b, c):
# stmts.append(statement)
# assert most_frequent_queries(...) == ??
def most_frequent_queries(queries, query_count, query_type, query_print_length):
select_sql_statement_groupings = {}
for statement in queries:
@compwron
compwron / relay.py
Created April 5, 2020 05:42
python2 port forward proxy
#!/usr/bin/python
# Thanks https://gist.github.com/gschizas/3731989
# This is a simple port-forward / proxy, written using only the default python
# library. If you want to make a suggestion or fix something you can contact-me
# at voorloop_at_gmail.com
# Distributed over IDC(I Don't Care) license
import socket
import select
import time