Skip to content

Instantly share code, notes, and snippets.

View bennycwong's full-sized avatar
🎸

Benny C. Wong bennycwong

🎸
View GitHub Profile

Product Sense and Business Sense for Engineers

A Director's Guide to Building Business-Savvy Engineering Organizations


Table of Contents

  1. Introduction
  2. Core Concepts
  3. Glossary
#put oids in here
oids = %w(
)
orders = Order.where(id: oids).where(status: 'canceled_by_seller_review');
@bennycwong
bennycwong / kill_sonos.sh
Last active April 25, 2018 18:19
kill sonos
#!/bin/sh
while :
do
zone=$(sonos list-zones 2>&1 | head -n 1)
sonos-cli --zone $zone volume [0]
sonos-cli --zone $zone stop
sleep 1
done
@bennycwong
bennycwong / git-cleanup
Created August 17, 2016 01:05
TIL: Clean up all branches except master (or another other rule you want)
git branch | grep -v master | xargs -n 1 git branch -D
git brach list branches
grep -v is a filter
xargs -n 1 pass in the arguments
git branch -D is the command.
@bennycwong
bennycwong / array.ex
Last active July 8, 2016 21:53
Elixir Example
defmodule Array do
def sum([]) do
0
end
def sum([ head | tail ]) do
head + sum(tail)
end
@bennycwong
bennycwong / fizzbuzz.exs
Created January 11, 2016 07:10
This is an implementation of FizzBuzz in Elixir
fizzbuzz = fn
0, 0, _ -> "FizzBuzz"
0, _, _ -> "Fizz"
_, 0, _ -> "Buzz"
_, _, n -> n
end
fb = fn
n -> fizzbuzz.( rem(n,3) , rem(n,5) , n) |> IO.puts
end
@bennycwong
bennycwong / README.md
Last active March 17, 2016 23:12
Random Reddit