Skip to content

Instantly share code, notes, and snippets.

View steinybot's full-sized avatar

Jason Pickens steinybot

View GitHub Profile
@steinybot
steinybot / README.md
Last active April 12, 2024 01:44
Google Sheets Functions

Named Functions

COLUMNADDRESS

Column reference as a string.

Arguments:

Name Description Example
@steinybot
steinybot / RANT.md
Created August 10, 2023 00:18
Rant about GraphQL input and output types

graphql/graphql-spec#1038

I'm sure there must be a reason (valid or historical) but distinguishing between input and output types seems to serve no real purpose and comes with a significant cost.

By no means the authority but perhaps a good starting point are the reasons that ChatGPT give:

In GraphQL, the distinction between regular types (also known as output types) and input types serves a specific purpose to ensure clarity, maintainability, and type safety. While it might seem convenient to use any type as an input type, there are valid reasons for this separation:

Please ChatGPT, do tell...

@steinybot
steinybot / git.mergetool-moved.sh
Last active November 17, 2022 21:59
Perform a git merge across renames and/or splits.
#!/usr/bin/env bash
set -euo pipefail
# Ever move a file, merge main, then get hit with this?
#
# Deleted merge conflict for 'foo.txt':
# {local}: deleted
# {remote}: modified file
# Use (m)odified or (d)eleted file, or (a)bort?
#
@steinybot
steinybot / !README.md
Created July 11, 2022 01:23
Scala.js - Nice source maps for exceptions
    // TODO: Determine whether we need traceKitWindowOnError to map the errors too.
    dom.window.asInstanceOf[std.Window].onerror = toUnionLeft(onErrorEventHandler _)
  private def onErrorEventHandler(
    event: dom.Event | String,
    source: js.UndefOr[String],
    lineno: js.UndefOr[Double],
@steinybot
steinybot / README.md
Created April 21, 2022 01:55
Debugging Scala Macros
scalacOptions ++= Seq(
  "-Ybrowse:typer",
  "-Xprint:typer",
  "-Xlog-implicits"
)
@steinybot
steinybot / README.md
Created April 19, 2022 00:03
Nix Tips

Nix Tips

Build a package from a different system (e.g. run Intel package under Rosetta 2):

nix-build -A pkgsCross.x86_64-darwin.hello

Run nix-shell with local packages:

nix-shell -I nixpkgs=/Users/jason/src/nixpkgs
@steinybot
steinybot / README.md
Last active January 26, 2022 20:50
New MacBook Setup

New MacBook Setup

For the automated setup run:

sh <(curl -L https://gist.githubusercontent.com/steinybot/085ef82571f4416506388c6a1e58637a/raw/9d71a417534813082fd02a4820eff92420c45040/bootstrap.sh)

For the manual setup follow the steps below:

@steinybot
steinybot / Errors.scala
Created January 16, 2022 21:04
Better Scala.js Stack Traces
package errors
import scala.concurrent.{ExecutionContext, Future}
import scala.language.{implicitConversions, reflectiveCalls}
import scala.scalajs.js
object Errors {
def mapJsError(
message: String,
@steinybot
steinybot / !README.md
Last active February 17, 2021 22:53
Boo for Boopickle
@steinybot
steinybot / benchmark.sh
Created January 28, 2021 10:44
Benchmark script
#!/usr/bin/env bash
set -euo pipefail
REPEATS=100
OUTPUT_FILE='results.csv'
run_tests() {
echo "Benchmarking ${COMMAND[@]}"