Skip to content

Instantly share code, notes, and snippets.

View compwron's full-sized avatar
💭
https://github.com/drop-ice/dear-github-2.0

compwron compwron

💭
https://github.com/drop-ice/dear-github-2.0
View GitHub Profile
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
@compwron
compwron / _populate_missing_weeks.py
Created February 27, 2020 08:41
code that thankfully we don't need to _populate_missing_weeks
def _populate_missing_weeks(session: Session,
result_dict: List[Dict[str, str]], start_date: str, end_date: str) -> List[Dict[str, str]]:
# result_dict_week_start_dates = list(map(lambda data: data['start'], result_dict))
result_dict_week_start_dates = set(data['start'] for data in result_dict)
for week_start, week_end in _week_starts_between(session, start_date, end_date):
if week_start not in result_dict_week_start_dates:
result_dict.append({
'messages_received_per_patient': Decimal(0),
'start': week_start,
'end': week_end
@compwron
compwron / auto_transcript.txt
Last active February 27, 2020 03:09
Youtube's automated transcript of an interview with Dr. Kathy Leonard from Publix
https://www.youtube.com/watch?v=58FpZrp48Oo
[Music] welcome back to our in my podcast my name is Nima I'm an and today we're joined by dr. Cathy Leonard the pharmacy operations manager at Publix thank you for joining us thank you for having me so we see here that you actually greeted us very well so we want to thank you first for giving us these gifts really appreciate it so um presentation seems like it's very key at Publix is that something that you guys are about is that is that something that you guys instill absolutely I think it's part of just human nature you know you look for the best qualities and in people and how they present you both all of you have presented yourselves very well this morning but you look for that it makes that first impression on people and it's no different in our stores from how our pharmacists interact with patients how they interact with prescribers and how they interact with each other all goes a long way with our customers and the brand and what we're trying to build at Pub