Skip to content

Instantly share code, notes, and snippets.

@blakewest
blakewest / mnist_example.ipynb
Created February 9, 2018 17:26
Example implementation of a Convolutional Neural Net for the MNIST data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blakewest
blakewest / logistic_regression_example.py
Created February 5, 2018 22:38
A starter implementation for logistic regression.
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import confusion_matrix
from sklearn.model_selection import train_test_split
def load_data(path):
# Load the data into a Pandas dataframe.
raw_data = pd.read_csv(path, header=0)
print('Loaded data from', path)
return raw_data
FROM quay.io/aptible/java:oracle-java8
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
RUN apt-get update && apt-get -y install libc6-dev unzip curl
RUN groupadd looker && useradd -m -g looker -s /bin/bash looker
ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.5/supercronic-linux-amd64 \
SUPERCRONIC=supercronic-linux-amd64 \
SUPERCRONIC_SHA1SUM=9aeb41e00cc7b71d30d33c57a2333f2c2581a201
@blakewest
blakewest / procedures_api2.js
Last active June 2, 2017 01:15
Options 2 ("Visits") for Hint Procedures API
/*
// Option 2: Visits
// Standard CRUD actions to /api/provider/visits
// GET /api/provider/visits
// POST /api/provider/visits
// GET /api/provider/visits/:id
// PATCH /api/provider/visits/:id
// DELETE /api/provider/visits/:id
@blakewest
blakewest / procedures_api.js
Last active June 2, 2017 01:05
Procedures API Option 1.1 ("procedures w/ visit_id")
/*
// Option 1: Procedures with visit_id
// Standard CRUD actions to /api/provider/procedures
// GET /api/provider/procedures
// POST /api/provider/procedures
// GET /api/provider/procedures/:id
// PATCH /api/provider/procedures/:id
// DELETE /api/provider/procedures/:id
class Forest::MembershipPatient
include ForestLiana::Collection
collection :membership_patients
field :name, type: 'String' do |object|
::MembershipPatient.unscoped.find(object.id).name
end
end
@blakewest
blakewest / naming_journal.rb
Last active September 19, 2016 21:11
A place to write down snippets of the process we go through when naming things.
# 1
# Method name history was...
# nil (did both things in one method) --> generate_csv_for_revenue_lines
def generate_csv_for_revenue_lines(revenue_lines)
# name history...
# res -> pg_result
pg_result = execute_sql("SELECT * FROM recognized_revenue WHERE" +
+ " revenue_line_id IN (?)", revenue_lines.pluck(:id).join(",")
)
pg_result.values
# Pseudo code for doing a big zuora export
# Pull all_account_ids from a CSV export, or potentially from ActiveZuora::Account. Only issue with the latter
# is that it might timeout if you have too many accounts.
all_account_ids.each do |account_id|
list_of_all_soap_objects.each do |soap_object|
# A soap_object would be something like Invoice, Payment, CreditBalanceAdjustment, etc.
active_zuora_klass = "ActiveZuora::#{soap_object}".constantize
active_zuora_klass.where(account_id: account_id).find_each do |zuora_object|
# This is just a placeholder. I'm not sure what database you'd use to actually store things.
@blakewest
blakewest / elm_tutorial_suggestions.md
Created August 11, 2016 01:22
No Red Ink Elm Tutorial Suggestions

Hey there Richard. Ok, here were the items that got me a bit confused:

1.) You linked to this file, but the code that is in the actual tutorial doesn't match up (I assume cause you updated it at some point?). But either way, if someone wanted to download the file, it wouldn't match.

2.) Right after copying that opening file (right above the "Let's build this, shall we?" part, it asks you to build it, but that file won't build, and not because of the reasons you predict in the post. It doesn't build because we're missing some things.. a.) initialModel does not exist. And we also need to set "errors" on the initial model. So I would suggest doing this..

@blakewest
blakewest / feature_checklist_for_building_awesome_products.md
Last active May 19, 2016 20:27
We use this checklist at Hint for every feature (not bugs or chores) that we build. It has been iterated on many times, and informed by years of experience, as well as the book Designing Products People Love. We've found it to very helpful in surfacing issues ahead of time, and making sure we don't waste people's time during development.

Why We Use This Checklist:

  • Hint Health is an enterprise software company with only a handful of engineers. We handle payments for big health care clients, and we can't afford to "just try whatever". We have to balance speed with getting things right the first time. This checklist has been iterated on many times, and has proved very helpful in doing that.
  • The goal here is to 1.) Make sure you build things people want. And 2.) Surface problems and implications of the design as fast as possible, by reminding ourselves of important questions that can easily get overlooked.

How To Use:

  • Use the top area to consolidate the latest thinking on the feature. (on that point, we don't use this for bugs or chores. only features)
  • Use the checklist at the bottom to make sure you're asking the right questions, and do a kick ass job of defining, designing, and implementing the feature.
  • As soon as you're like... "we should build X", stop and do the User Requirements Pipeline. This