Skip to content

Instantly share code, notes, and snippets.

Harlow Ward harlow

View GitHub Profile
@harlow
harlow / frc.md
Last active Aug 14, 2019
Eng Management
View frc.md

Recently, we were fortunate to bring together top CTO talent from inside and outside the First Round Community to share best practices, challenges and insights. Key topics included how to create a great management team, introducing structure to your org, and tools for better technical productivity. Notes from this session are below.

BUILDING STRONG MANAGEMENT

  • It's easy to build a management structure when things are early and small. But don't over-optimize this structure. It will change as you bring people on. For example, don't give out management titles until you have at least four teams.
  • The best tactic is to have everyone start out as an engineer, then hire an engineering director and split the team in half. This is the cell-splitting model -- grow a team then split it into different cells.
  • Don't promote people into management roles too early. It's better to hire a manager than to promote from within the ranks. The latter only causes conflict.
  • Always remember, while someone might be a bril
@harlow
harlow / first-name-synonyms.csv
Last active Jul 9, 2020
First name synonyms for Elasticsearch synonym filter
View first-name-synonyms.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 4 columns, instead of 5. in line 1.
aaron,erin,ron,ronnie
abel,ab,abe,eb,ebbie
abiel,ab
abigail,abby,gail,gail,nabby
abner,ab
abraham,ab,abe
abram,ab
adaline,ada,addy,delia,dell,lena
adelaide,addy,adele,dell,della,heidi
adeline,ada,addy,delia,dell,lena
@harlow
harlow / streams_to_firehose.go
Last active Dec 28, 2019
Golang lambda function to send Streams data to Firehose
View streams_to_firehose.go
package main
import (
"github.com/apex/go-apex"
"github.com/apex/go-apex/kinesis"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/firehose"
)
@harlow
harlow / kinesis.js
Last active Apr 27, 2018
Lambda Functions
View kinesis.js
console.log('Loading function');
exports.handler = function(event, context) {
//console.log('Received event:', JSON.stringify(event, null, 2));
event.Records.forEach(function(record) {
// Kinesis data is base64 encoded so decode here
var payload = new Buffer(record.kinesis.data, 'base64').toString('ascii');
console.log('Decoded payload:', payload);
});
context.succeed("Successfully processed " + event.Records.length + " records.");
@harlow
harlow / lookup_found_webhook.json
Last active Sep 6, 2015
Example webhook from Company API
View lookup_found_webhook.json
{
"id": "custom_id", // the webhook_id passed in the lookup params
"status": 200,
"type": "company",
"body": {
// Company attributes
}
}
@harlow
harlow / golang_job_queue.md
Last active Jul 29, 2020
Job queues in Golang
View golang_job_queue.md
View issues_with_modules.md

My issues with Modules

In researching topics for RailsCasts I often read code in Rails and other gems. This is a great exercise to do. Not only will you pick up some coding tips, but it can help you better understand what makes code readable.

A common practice to organize code in gems is to divide it into modules. When this is done extensively I find it becomes very difficult to read. Before I explain further, a quick detour on instance_eval.

You can find instance_eval used in many DSLs: from routes to state machines. Here's an example from Thinking Sphinx.

class Article < ActiveRecord::Base
@harlow
harlow / hoteltonight.json
Created Apr 15, 2015
HotelTonight lookup on Clearbit
View hoteltonight.json
{
"id": "d5639304-f15a-48b5-9711-7bd42e6c4d72",
"name": "HotelTonight",
"legalName": "HotelTonight, Inc",
"domain": "hoteltonight.com",
"url": "http://hoteltonight.com",
"site": {
"url": "http://hoteltonight.com",
"title": "HotelTonight | Last-Minute Deals on Great Hotels",
"h1": "PLAN LESS. ",
@harlow
harlow / fake_github.rb
Last active Aug 29, 2015
Have stubbed service emulate failures
View fake_github.rb
require 'sinatra/base'
class FakeGitHub < Sinatra::Base
cattr_reader :emulate_failure
def self.reset!
@@emulate_failure = false
end
def self.emulate_failure!
View 0000_packages.config
# Install Git needed for Git based gems
packages:
yum:
git: []
You can’t perform that action at this time.