Skip to content

Instantly share code, notes, and snippets.

@nwjsmith
nwjsmith / keymap.json
Created March 1, 2024 15:00
DOOM-like window movement bindings for Zed
[
{
"context": "Editor && (vim_mode == normal || vim_mode == visual) && !VimWaiting && !menu",
"bindings": {
"space w v": "pane::SplitRight",
"space w s": "pane::SplitDown",
"space w h": ["workspace::ActivatePaneInDirection", "Left"],
"space w j": ["workspace::ActivatePaneInDirection", "Down"],
"space w k": ["workspace::ActivatePaneInDirection", "Up"],
"space w l": ["workspace::ActivatePaneInDirection", "Right"]

Keybase proof

I hereby claim:

  • I am nwjsmith on github.
  • I am nwjsmith (https://keybase.io/nwjsmith) on keybase.
  • I have a public key whose fingerprint is DE6F E362 7DF7 EEA0 79CB 38C1 F208 9547 768B 6CCA

To claim this, I am signing this object:

@nwjsmith
nwjsmith / SketchSystems.spec
Created August 10, 2019 17:15
Uninstalled*
Uninstalled*
Request installation -> Validating request
Validating request
Request invalid -> Bad installation request
Request valid -> Installed
Bad installation request
Installed
@nwjsmith
nwjsmith / SketchSystems.spec
Last active November 22, 2018 16:23
Pending*
Pending*
Build Pending
unblocked -> Running
Running
Build Running
Failing
Canceling
Unauthorized
Succeeded
Failed

Keybase proof

I hereby claim:

  • I am nwjsmith on github.
  • I am nwjsmith (https://keybase.io/nwjsmith) on keybase.
  • I have a public key ASCy88BjLsb0e4DMZnPdVUY57G532OZxKRpLFJASzljGJwo

To claim this, I am signing this object:

@nwjsmith
nwjsmith / instrument-fixture-fn.clj
Created February 20, 2018 18:20
Instrumenting fixture.
(defn instrument-fixture-fn
"Returns a function to be used as a clojure.test fixture. The fixture will
instrument the vars named by sym-or-syms, a symbol or collection of symbols,
or all instrumentable vars if the sym-or-syms is not specified. Any
previously instrumented vars will be unstrumented before the test run and
re-instrumented afterwards. Takes the same arguments as
`clojure.spec.test.alpha/instrument`."
([] (instrument-fixture-fn (stest/instrumentable-syms)))
([sym-or-syms] (instrument-fixture-fn sym-or-syms {}))
([sym-or-syms opts]
@nwjsmith
nwjsmith / gen_dag.clj
Created June 3, 2017 15:12
A test.check generator for a DAG
(def gen-node
"Generates graph nodes."
(gen/fmap str gen/uuid))
(defn gen-connecting-edges
"Generates edges between a connecting node and some subset of the given
nodes."
[connecting-node nodes]
(gen/fmap (partial map (partial vector connecting-node))
#!/bin/bash
set -e
GRPC_FORMULA_URL="https://raw.githubusercontent.com/grpc/homebrew-grpc/bcff6876c0f692508e394ba01801e3aced083395/Formula/grpc.rb"
GOOGLE_PROTOBUF_FORMULA_URL="https://raw.githubusercontent.com/grpc/homebrew-grpc/bcff6876c0f692508e394ba01801e3aced083395/Formula/google-protobuf.rb"
PROTOC_GEN_GRPC_JAVA_URL="http://search.maven.org/remotecontent?filepath=io/grpc/protoc-gen-grpc-java/1.1.2/protoc-gen-grpc-java-1.1.2-osx-x86_64.exe"
PROTOC_GEN_GRPC_JAVA_PATH="/usr/local/bin/protoc-gen-grpc-java"
brew unlink google-protobuf grpc
brew install --without-python "${GOOGLE_PROTOBUF_FORMULA_URL}"
require 'net/http'
require 'thread'
require 'uri'
uri = URI('http://theinternate.com')
response_queue = Queue.new
threads = (1..3).map do
Thread.new do |thread|
response_queue << Net::HTTP.get_response(uri)
@nwjsmith
nwjsmith / encode.sh
Created August 10, 2016 20:51
ffmpeg
ffmpeg -i source.mov -c:v libx264 -crf 18 -profile:v high -level 4.0 -pix_fmt yuv420p -preset veryslow -tune animation output.mp4