Skip to content

Instantly share code, notes, and snippets.

View leehambley's full-sized avatar

Lee Hambley leehambley

View GitHub Profile

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

Senior Backend Developer at Devengo

Devengo is a startup focused on a simple but ambitious mission: make finance a fairer place. Founded by well-known fintech players Fernando Cabello-Astolfi and Alberto Molpeceres our first product is an innovative social benefit that allows workers to collect their earned wages in real-time. Your money, when you need it.

The problem

Economists identify¹ three main challenges any person and household must face to reach a sustainable level of financial wellness: having sufficient and stable income, maintaining an economic-financial balance that limits problems of overindebtedness and avoiding severe poverty.

The last two challenges are the most pressing ones as they have an immediate effect on the material living conditions of the population and they compound over time sinking the households' economies further and further.

In Spain al

Create users on a KeyCloak instance

The KeyCloak REST API only allows mass insertion of the users at the Realm initialization time.

Creating users on the REST API is pretty well documented, but painful enough that it took a couple of hours to muddle through the reqired options to make this script do the right thing:

  • Create the user
  • Add them to a group
  • Send the password (re)set email
@leehambley
leehambley / readme.md
Created September 23, 2020 13:20
Example for decoding a JWT Payload with your Shell (bash, zsh...)

Setup

Add this to your .profile, .bashrc, .zshrc...

_decode_base64_url() {
  local len=$((${#1} % 4))
  local result="$1"
  if [ $len -eq 2 ]; then result="$1"'=='
  elif [ $len -eq 3 ]; then result="$1"'=' 
  fi
 echo "$result" | tr '_-' '/+' | base64 -d
@leehambley
leehambley / database.tf
Created July 14, 2020 18:42 — forked from smiller171/database.tf
Manage RDS password in Terraform in a sane way
resource "random_string" "db_master_pass" {
length = 40
special = true
min_special = 5
override_special = "!#$%^&*()-_=+[]{}<>:?"
keepers = {
pass_version = 1
}
}
resource "aws_ses_domain_identity" "zbn" {
domain = var.zone_base_name
}
resource "aws_ses_domain_mail_from" "contact_form" {
domain = aws_ses_domain_identity.zbn.domain
mail_from_domain = "bounce.${aws_ses_domain_identity.zbn.domain}"
}
resource "aws_api_gateway_account" "quasar" {
@leehambley
leehambley / main.go
Created March 23, 2020 14:58 — forked from marians/main.go
OAuth 2.0 authentication in a Golang CLI
package main
import (
"context"
"crypto/tls"
"fmt"
"log"
"net/http"
"net/url"
"time"
@leehambley
leehambley / tikka_masala.md
Created January 23, 2020 15:27 — forked from headius/tikka_masala.md
Chicken Tikka Masala

Chicken tikka masala

Time: 50 minutes

Serves: 4-6

Ingredients

#!/usr/bin/env ruby
IAM_ARNS = {
web_app: '...',
mobile_app: '...',
admin_app: '',
backups_script: '',
}
# Connect to KMS

Restartable iterator

I needed this for a kind of index that allows me to subscribe to a tag in a git repo, but also get notified on a rebase or a head pointer move.

I was getting bogged down in the details (Git is a single-linked list starting at the head, so walking over it from the first commits to the newest commits is tricky)

This iterator seems to fulfil my needs around tracking the position within the list, and being able to reset.

The meta API (pointer, implements error interface, has other methods for checking if rewound or EOF) seems to be as neat as one could hope to expect.