Skip to content

Instantly share code, notes, and snippets.

@squarism
squarism / iterm2.md
Last active December 6, 2024 19:33
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@squarism
squarism / how_fast_does_an_llm_type.md
Last active November 21, 2024 18:57
How fast does an LLM type?

Using Claude 3.5 Sonnet Pro, I asked it to generate prose paragraphs.

Using a stopwatch, I started timing when I started seeing characters appear and stopped when the LLM stopped sending text. I figure that the latency is the same both ways so I do not need to compensate for that.

Run 1 - 6.4 sec - 252 words (2362 WPM)
Run 2 - 6.6 sec - 239 words (2172 WPM)
Run 3 - 7.5 sec - 273 words (2184 WPM)
@squarism
squarism / cli_replacements.md
Last active September 15, 2024 00:14
Modern CLI Replacements

There are a few lists already, I thought I'd create another one so we can have a long list of lists someday. 🤠 Ordered by approximately which ones I actually use often.

Modern CLI Replacements

  • zoxide - A smarter cd command. Supports all major shells.
  • mcfly - Fly through your shell history. Great Scott!
  • Procs - A modern replacement for ps written in Rust
  • sd - Intuitive find & replace CLI (sed alternative)
  • dust - A more intuitive version of du in rust
  • hyperfine - A command-line benchmarking tool
@squarism
squarism / .gitlab-ci.yml
Created May 30, 2023 21:37
Gitlab and Vitest Code Coverage with c8
# stages:
# - whatever
# - test
vitest:
stage: test
script:
# assuming scripts: has "test": "vitest" ...
# run your tests with coverage output
- npm test -- run --coverage
@squarism
squarism / english_is_terrible.md
Last active August 20, 2024 02:02
English is Terrible

I'm sad that the world has adopted English as the language of science and business. English is a mutt language that has never been redone, reworked or even designed. It's a combination of ice cream, meatballs and wine. All fine things by themselves but terrible when combined.

There are more English learners than there are native English speakers in the world. I'm really sorry world. I'm just so so sorry that you have to learn Germanic-French-Latin nonsense. It's terrible. It's a terrible language.

Update: I wrote this before I read Mother Tongue by Bill Bryson. It's fantastic and a better write-up of what I'm trying to say here.


Prepositional phrases

@squarism
squarism / baseball_stories.txt
Last active July 24, 2024 05:29
Baseball Stories
Strike Out
----------
1. Pitcher pitches ball
2. A strike happens
3. Umpire sees strike
4. Umpire updates internal count
5. Umpire shouts strike to field
6. Pitcher pitches ball, after hearing call in field
... repeat
7. Third strike is called
@squarism
squarism / stop_sms_spam_on_ios.md
Last active April 29, 2024 23:03
How to send STOP to SMS spam using iOS automation

Credit to Time Johnsen

⚠️ Please consider that this might not be a good idea. It's up to you. I feel like spammers are going to spam, so, idk.

How to Automatically Reply Stop to SMS Spam

  1. Open Shortcuts
  2. Click the bottom tab Automation at the bottom center. It's not Shortcuts, it's Automation.
  3. Create a new Automation using + at the top. This will open Personal Automation and you'll be looking at a list.
@squarism
squarism / amazon_is_almost.md
Last active April 22, 2024 22:39
Amazon is Almost

Amazon is Almost

AWS is full of almost things. This is a list of surprises across all services. Your job as an engineer is to think critically about trade offs. Amazon is an abstraction on hardware. You reap hardware bliss ignorance but you pay for the abstraction. There is no free lunch. Hardware still exists. Hardware in itself is an abstraction.

With AWS you are renting a hardware abstraction to avoid having to host your own. They do not run the abstractions after this point. You do.

@squarism
squarism / aws_secret_gen.go
Last active March 30, 2024 20:09
AWS Secret Generator - Useful with Minio or self hosted services when you need an AWS style secret pair
package main
import (
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"flag"
"fmt"
"math/rand"
"os"
@squarism
squarism / multiline.exs
Last active March 25, 2024 15:27
Multiline Anonymous Functions in Elixir
# Examples of Different Styles and Syntax
# legal / positive case / you can do these stuffs
# ---------------------------------------------------------------------------
# single line, nothing special
Enum.map(0...2, fn i -> IO.puts i end)
"""
0
1