Skip to content

Instantly share code, notes, and snippets.

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 Dec 29, 2018
Rails bin/setup script, from refactoringrails.io
View setup.sh
#!/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 Aug 28, 2019
Helpful retrospective (retro) questions
View retro-questions.md

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 Aug 29, 2019
uBlock Origin filters to remove annoying Twitter features
View gist:2f243be6c30325f6a9b31844d91fc910
twitter.com##.trends.Trends.module
twitter.com##.dashboard-right.dashboard
twitter.com##.module.DashboardProfileCard
View setup.sh
#!/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
View Q.elm
isValidUrl : String -> Bool
isValidUrl str =
List.all
((|>) str)
[ isLower, hasNoSpaces ]
View customer-support.md

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:

View also-slow.cljs
(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))]
View failing.cljs
(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))
View failing.cljs
(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))
View Embarrassing.elm
-- 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
You can’t perform that action at this time.