Skip to content

Instantly share code, notes, and snippets.

View r00k's full-sized avatar
💭
Working on Tuple (https://tuple.app)

Ben Orenstein r00k

💭
Working on Tuple (https://tuple.app)
View GitHub Profile
@r00k
r00k / setup.sh
Last active December 29, 2018 16:41
Rails bin/setup script, from refactoringrails.io
#!/bin/sh
# Set up Rails app. Run this script immediately after cloning the codebase.
# Exit if any subcommand fails
set -e
# Copy over configs
if ! [ -f .env ]; then
cp .sample.env .env
@r00k
r00k / retro-questions.md
Last active May 27, 2022 21:59
Helpful retrospective (retro) questions

Retro Questions

  • KPI dashboard review
  • Since our last retro, what's gone well?
  • How do we feel about our productivity and work/life balance
  • How is the product better than last week?
  • How is the company better than last week?
  • Is there anything we should ask a consultant about?
  • How is the office/ops?
  • How can we enjoy the journey more?
@r00k
r00k / gist:2f243be6c30325f6a9b31844d91fc910
Last active August 29, 2019 21:04
uBlock Origin filters to remove annoying Twitter features
twitter.com##.trends.Trends.module
twitter.com##.dashboard-right.dashboard
twitter.com##.module.DashboardProfileCard
#!/bin/sh
# Set up Rails app. Run this script immediately after cloning the codebase.
# Exit if any subcommand fails
set -e
# Copy over configs
if ! [ -f .env ]; then
cp .sample.env .env
isValidUrl : String -> Bool
isValidUrl str =
List.all
((|>) str)
[ isLower, hasNoSpaces ]

Description

We're looking to hire a part-time support person (exact hours TBD) to help out the customers of our three products. Wait, three products? Yeah, turns out we like starting things.

Here they are, in all their developer-focused glory:

(defn calculate-fitness [reference-image-data individual-image-data]
"Takes two vectors of ints 0-255, representing the rgba data for our
reference image and individual-image-data. Returns the sum of squares
difference between the two, which represents how similar the two images are."
(let [differences (map - reference-image-data individual-image-data)
squares (map #(* % %) differences)
my-ints (int-array squares)
sum-of-squares (areduce my-ints idx ret 0 (+ ret (aget my-ints idx)))
maximum-difference (* (count reference-image-data)
(* 256 256))]
(ns barb.core
(:require [clojure.browser.repl :as repl]
[cljs.spec :as s]
[clojure.spec.test :as stest]
[cljs.spec.impl.gen :as gen]))
(defn simple [x] x)
(s/fdef simple :args int? :ret int?)
(println (stest/check `simple))
(ns example.core
(:require [clojure.browser.repl :as repl]
[cljs.spec :as s]
[clojure.spec.test :as stest]
[cljs.spec.impl.gen :as gen]))
(defn simple [x] x)
(s/fdef simple :args int? :ret int?)
(println (stest/check `simple))
-- Goal: add/substract a small random amount from each component (r, g, b, a)
-- of the passed-in color.
maybeMutateColor : Color -> Generator Color
maybeMutateColor color =
let
floatGenerator =
Random.float -maximumAlphaChange maximumAlphaChange
intGenerator =
Random.int -maximumRGBChange maximumRGBChange