Skip to content

Instantly share code, notes, and snippets.

View mrb's full-sized avatar
🍕
Helping companies market and sell more software

Michael Bernstein mrb

🍕
Helping companies market and sell more software
View GitHub Profile
@mrb
mrb / Tiger.idr
Created October 24, 2014 15:04
A little straight line program interpreter I implemented from the "modern compiler implementation in ML" book by Appel
module Main
import Control.Monad.Writer
Id : Type
Id = String
data Binop = Plus | Minus | Times
mutual
@mrb
mrb / typecher.ml
Created February 20, 2014 01:21
Simple Typed Lambda Calculus Typechecking Function in OCaml
let rec typeof ctx t =
match t with
TmVar(fi,i,_) -> getTypeFromContext fi ctx i
| TmAbs(fi,x,tyT1,t2) ->
let ctx' = addbinding ctx x (VarBind(tyT1)) in
let tyT2 = typeof ctx' t2 in
TyArr(tyT1, tyT2)
| TmApp(fi,t1,t2) ->
let tyT1 = typeof ctx t1 in
let tyT2 = typeof ctx t2 in
#lang racket
;; A computer program tells a computer what to do
;; A computer program is made up of "code"
;; "Code" is different instructions that you can give the computer
;; For example, if you want the computer to add two numbers together,
;; you can ask it like this:
(+ 10 10)
@mrb
mrb / Main.elm
Created September 12, 2016 00:50
JSON Fetch and Filtering
module Main exposing (..)
import Html exposing (Html, div, button, text, img, br, p)
import Html.Attributes exposing (src, width)
import Html.Events exposing (onClick)
import Html.App
import Http
import Task exposing (Task)
import Json.Decode as Decode exposing (Decoder(..), string, (:=), succeed, list)
import Extra exposing ((|:))
@mrb
mrb / Main.elm
Created September 9, 2016 14:44
Tips
module Main exposing (..)
import Html exposing (Html, div, button, text, img, br, p)
import Html.Attributes exposing (src)
import Html.Events exposing (onClick)
import Html.App
import Http
import Task exposing (Task)
import Json.Decode as Decode exposing (Decoder(..), string, (:=), succeed, list)
import Extra exposing ((|:))
def format(result)
# The data I want is deeply nested in the "result" hash
results = result.first[1]["coverage"]
end
@mrb
mrb / tips.json
Last active September 8, 2016 02:23
[{"layout":"tip","title":"Tip #1: Never Cook The Pizza Sauce","date":"2016-01-04 10:15","categories":"tips","tags":"food","image":"http://d5e3yh7f757go.cloudfront.net/tips/tip-1-sauce.jpg","thumbnail":"http://d5e3yh7f757go.cloudfront.net/tips/thumbs/tip-1-sauce.jpg"}]
# ruby 1.9 supports 4 ways to call a proc! ex: f =->n {[:hello, n]}; f[:ruby]; f.call(:ruby); f.(:ruby)
#
# turns out, you can also call a proc via proc === :arg -- which means you can use proc's in when clauses!
# ruby doc: http://ruby-doc.org/ruby-1.9/classes/Proc.html#M001165
#
# ... kudos to @chadfowler for the tip!
#
# (note: works on 1.8.7 as well :-))
def am_i_awesome?
@mrb
mrb / erb.rb
Last active May 23, 2016 15:41
class ShoppingList
attr_accessor :items
def initialize(items)
@items = items
end
# Expose private binding() method.
def get_binding
binding()

Home Portfolio Briefings Team Contact LPs

January 17, 2014 Success at Work, Failure at Home

One of the differences between being a DECENT HUMAN BEING and a venture capitalist is that I obviously meet with many more DECENT HUMAN BEINGs now than I did then. As such, it has become more apparent that many of my struggles as a DECENT HUMAN BEING are surprisingly common. One observation that stands out, probably because it is rarely discussed, is how many founder/DECENT HUMAN BEINGs have relationship struggles with their significant others and families. For me, the brightest years at IronPort were without a doubt the darkest years at home. While I was focused, motivating, articulate, and decisive at work, I was inconsiderate, preoccupied, self-centered, and lazy at home.

Now, having worked through that time with my family, I’m in a much better place to reflect on what happened, how I could have handled things differently, and offer some advice to other founders who may be caught up in a similar dynamic.

As a fi