Skip to content

Instantly share code, notes, and snippets.

@squarism
squarism / typescript_enums_and_types_03.ts
Created May 31, 2022 22:31
Typescript Enums and Types 03
type AnimalToPet = {
kind: string
target: CalicoCat | SphynxCat | Turtle
}
type Animal = {
appearance: string
}
type CalicoCat = Animal & {
x = 1
// this is not the complete story of closure
// this is entirely lexical scope
const parentFunction = () => {
y = 50
console.log(x += 1)
console.log(y += 1)
const childFunction = () => {
@squarism
squarism / bunny.rb
Created November 6, 2021 22:20
Bunny Munching a 2D plot
# no time to write test, have to puts debug and develop.
# it's terrible
#
# https://coderpad.io/blog/practice-questions-from-our-friends-at-hackbright/
require_relative "./point"
require 'byebug'
class Bunny
attr_reader :munches
@squarism
squarism / schemaless_postgres.txt
Last active October 27, 2021 23:59
Schemaless Postgres
psql=# create table schemaless (
id json,
email json,
active json,
name json,
subscription json
);
CREATE TABLE
@squarism
squarism / the_bikeshed_insight.md
Last active September 15, 2023 22:13
Insight, Advice and Quotables from The Bikeshed Podcast

Self Care

and it's this very interesting little post where he talks about at the end of your day; you want to close the book on it. I think this is especially pointed now that many of us are working from home. For me, this is a new thing. And so, I've been very intentional with trying to put walks at the beginning and end of my day.

But in this particular blog post, he describes a routine that he does where he tidies things up and makes his list for the next day. And then he has a particular phrase that he says, which is "schedule shut down, complete."

294

Tool Sharpening List

Keeping track of very general pain points.

  • I'm not using my fish aliases enough.
  • I need to just switch back to zsh though.
  • It'd be cool to have an abbreviation for lock file resolution. It'd take an argument for the lock file name, probably would be great to have it be very smart (file existence, confirmation prompts, preview).

Make a function to do the authorized_keys dance but it takes an argument for the user.

@squarism
squarism / nice_webserver.py
Created August 26, 2021 05:53
A Nice Webserver
# You probably have python3 on a linux box you have lying around
# Save this as nice_webserver.py
# Run me with python3 nice_webserver.py
# It doesn't do anything bad, read it below
import socketserver
import time
class Server(socketserver.BaseRequestHandler):
@squarism
squarism / reaper_settings.md
Created June 21, 2021 21:44
The REAPER Blog's Fresh Start: REAPER 6 Settings

The REAPER Blog's Fresh Start: REAPER 6 Settings

https://www.youtube.com/watch?v=u5GU3mwJf2E

All these settings are opinions and preferences but captured here verbatim. Watch the video for more context.

Operating System Paths

  1. Create two directories on any drive you want for Backups and ReaPeaks. You will use these later.
@squarism
squarism / acquisition_change_promises.md
Last active September 8, 2022 21:58
Acquisition Change Promises

We Promise We Won't Change Anything

This whole post is probably overly negative but I keep noticing when companies make billion dollar investments/purchases and then promise not to change anything. And then we forget the PR promise as years go by. Talk is cheap, money is not cheap. What company would not want to exert influence or rake in returns? How would you even justify this to your shareholders (or boss) as a passive appendage? No, it's much more tempting to exert will and screw things up with your (maybe) larger or different culture that was not involved in the original success.

This is really, really, really not about the individual companies or data points. Rather, business mechanics.

@squarism
squarism / leading_questions.md
Last active June 10, 2021 21:52
Leading Questions About Immovables

I think the following questions are mostly about legacy but also fundamentals

  1. Why aren't there any spelling bees in Spanish?
  2. Why doesn't Chrome have a reading view? (this one not as much)
  3. Why does Windows have to install to C:? Why not Z:, 1:, A:, \c or /windows?
  4. Why wasn't there a Windows 9?
  5. Why is node_modules so large?

This is not the same kind of question: