Skip to content

Instantly share code, notes, and snippets.

View BBischof's full-sized avatar

Bryan Bischof BBischof

  • current: Theory Ventures | prev: Hex, Weights and Biases, Stitch Fix, Blue Bottle, QuasiCoherent Labs, IBM
  • Berkeley, California
  • X @bebischof
View GitHub Profile
@BBischof
BBischof / .block
Last active November 10, 2016 17:10
Multi-Line Voronoi.find() w/ speech data
license: gpl-3.0
@BBischof
BBischof / f_nulls.py
Created February 22, 2017 01:56
ternary applied to fix a np.column with some nulls based on index
'''does something to an i'''
def f:
return i
s = pd.Series([f(i) for i in df.index])
df['A'] = np.where(df['A'].notnull(), df['A'],s)
@BBischof
BBischof / exceptions.py
Created April 27, 2017 18:19
A nice python coding question
class B(Exception):
pass
class C(B):
pass
class D(C):
pass
for cls in [B, C, D]:
@BBischof
BBischof / .block
Last active May 7, 2017 02:29
Horsey Race
license: mit
@BBischof
BBischof / compute_product.py
Last active May 18, 2017 02:08
All the i's, j's, and k's from Finnegan's Wake
quats = {"ii":"-1",
"jj":"-1",
"kk":"-1",
"ij":"k",
"ji":"-k",
"ik":"-j",
"ki":"j",
"jk":"i",
"kj":"-i"
}
@BBischof
BBischof / output
Last active May 22, 2017 16:57
Arithmetic Billiards Racks
row 4: [5]
row 3: [4, 9]
row 2: [7, 11, 2]
row 1: [8, 1, 12, 10]
row 0: [6, 14, 15, 3, 13]
Remaining: []
row 4: [5]
row 3: [9, 4]
row 2: [2, 11, 7]
row 1: [10, 12, 1, 8]
@BBischof
BBischof / excel_split.py
Created September 13, 2017 19:29
A `.split()` function for excel—assumes 0 index, "-" delimiter, and reference cell "A2" but are all customizable. Outputs a string representation of the formula
def recurse(remaining_steps, delimiter='"-"', reference_cell="A2"):
if remaining_steps==0:
return 'SEARCH('+delimiter+','+reference_cell+')+1'
else:
return 'SEARCH('+delimiter+','+reference_cell+','+recurse(remaining_steps-1, delimiter, reference_cell)+')+1'
def build(i, delimiter='"-"', reference_cell="A2"):
if i<0:
raise ValueError
elif i==0:
@BBischof
BBischof / numbers_middle_letter.py
Created September 15, 2017 16:16
writing the numbers 1-100 in order and seeing the middle letter
number_list=["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty", "twenty-one", "twenty-two", "twenty-three", "twenty-four", "twenty-five", "twenty-six", "twenty-seven", "twenty-eight", "twenty-nine", "thirty", "thirty-one", "thirty-two", "thirty-three", "thirty-four", "thirty-five", "thirty-six", "thirty-seven", "thirty-eight", "thirty-nine", "forty", "forty-one", "forty-two", "forty-three", "forty-four", "forty-five", "forty-six", "forty-seven", "forty-eight", "forty-nine", "fifty", "fifty-one", "fifty-two", "fifty-three", "fifty-four", "fifty-five", "fifty-six", "fifty-seven", "fifty-eight", "fifty-nine", "sixty", "sixty-one", "sixty-two", "sixty-three", "sixty-four", "sixty-five", "sixty-six", "sixty-seven", "sixty-eight", "sixty-nine", "seventy", "seventy-one", "seventy-two", "seventy-three", "seventy-four", "seventy-five", "seventy-six", "seventy-seven", "seventy-eig
@BBischof
BBischof / BBCEngManagerChallenge.md
Last active January 9, 2019 12:12
Work-at-home Challenge for Blue Bottle Coffee Engineering Manager

Engineering Manager Challenge (Allot at least 2 hours)

Note: Don’t feel constrained by the time limits.

Consider the following scenario:

You have 2 scheduled roasts of Hayes Valley Espresso totaling 50lbs. (For simplicity, assume that all batches are maximum of 30lbs for physical reasons).

Roast A, 20lbs available. 
Roast B, 30lbs available. 
@BBischof
BBischof / BBCDevOpsChallenge.md
Last active October 30, 2017 23:47
Work-at-home Challenge for Blue Bottle Coffee DevOps Engineer

DevOps Coding Challenge (Allot at least 2 hours)

s3 manipulation

  • Clone the read-only bucket https://s3-us-west-2.amazonaws.com/bbc-devops-challenge/, and its contents into your personal s3 account. Read through each JSON file located on this your copy of this bucket. If the key "bump_waste_threshold" is not present in any .json files, add this key with a default value of '.23' and replace the old file.

Directory microservice

Generate a web application in a framework of your choice that does the following:

  • Connects to the s3 bucket cloned above, and stores a text representation of the subdirectories of the bucket in Redis (or a similar key-value store). This text representation should match the output format of the unix command tree. Additionally, store the json files as the values with keys given by their paths from the root of this bucket.
  • Serves the plain text of the directory tree from the root path of the application.
  • All non-root paths must return a sample of poetry(any