Skip to content

Instantly share code, notes, and snippets.

View encode.sh
ffmpeg -i source.mov -c:v libx264 -crf 18 -profile:v high -level 4.0 -pix_fmt yuv420p -preset veryslow -tune animation output.mp4
View keybase.md

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:

View SketchSystems.spec
Uninstalled*
Request installation -> Validating request
Validating request
Request invalid -> Bad installation request
Request valid -> Installed
Bad installation request
Installed
View SketchSystems.spec
Pending*
Build Pending
unblocked -> Running
Running
Build Running
Failing
Canceling
Unauthorized
Succeeded
Failed
View keybase.md

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:

View instrument-fixture-fn.clj
(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 Jun 3, 2017
A test.check generator for a DAG
View gen_dag.clj
(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))
View protobufs.sh
#!/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}"
View htttp.rb
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 / query_optim_core.clj
Last active May 31, 2016
A start on spec-ing Datomic queries
View query_optim_core.clj
(ns query-optim.core
(:require [clojure.spec :as s]
[clojure.spec.gen :as gen]
[clojure.string :refer [starts-with?]]
[clojure.test.check.generators :as generators]))
(s/def ::query
(s/cat :find-spec ::find-spec
:with-clause (s/? ::with-clause)