Skip to content

Instantly share code, notes, and snippets.

View bhardin's full-sized avatar
🍖
In meatspace

Brett Hardin bhardin

🍖
In meatspace
View GitHub Profile
@bhardin
bhardin / gist:962761029555b68f95fa
Created February 18, 2016 17:11
Cool.io Installation Error
Installing cool.io 1.2.4 with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/bhardin/.rbenv/versions/2.0.0-p643/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_thread_call_without_gvl()... yes
checking for rb_thread_alone()... yes
checking for rb_str_set_len()... yes
checking for clock_gettime() in -lrt... no

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

@bhardin
bhardin / create_release_notes.py
Created May 21, 2018 16:01
Create nice looking PR notes from a milestone
from github import Github
import os
import sys
release = str(sys.argv[1])
# or using an access token
GITHUB_ACCESS_TOKEN = os.environ['GITHUB_ACCESS_TOKEN']
g = Github(GITHUB_ACCESS_TOKEN)
FEATURES = 'Feature'
codecov:
token: uuid # Your private repository token
url: "http" # for Codecov Enterprise customers
slug: "owner/repo" # for Codecov Enterprise customers
branch: master # override the default branch
bot: username # set user whom will be the consumer of oauth requests
ci: # Custom CI domains if Codecov does not identify them automatically
- ci.domain.com
- !provider # ignore these providers when checking if CI passed
# ex. You may test on Travis, Circle, and AppVeyor, but only need
with
dau as (
-- This part of the query can be pretty much anything.
-- The only requirement is that it have three columns:
-- dt, user_id, inc_amt
-- Where dt is a date and user_id is some unique identifier for a user.
-- Each dt-user_id pair should be unique in this table.
-- inc_amt represents the amount of value that this user created on dt.
-- The most common case is
-- inc_amt = incremental revenue from the user on dt
@bhardin
bhardin / tmux-cheatsheet.md
Last active May 31, 2017 15:09 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
### MORE CODE ABOVE THIS ###
from datetime import timedelta
'add-every-30-seconds': {
'task': 'tasks.update_something',
'schedule': timedelta(seconds=30),
'args': (16, 16)
},
from celery.schedules import crontab
from myapp.common import constants
ALL = 'all'
tasks = {
# Tasks that should be run in all environments
ALL: {},
# Tasks that should be run on production
@bhardin
bhardin / long_running_tasks.py
Last active September 21, 2016 15:11
Examples of how to use celery beat
# app/some_cool_app/tasks.py
@celery_app.task(bind=True, queue=’whenever’)
def a_long_running_process(self):
process = LongRunningProcess()
process.run()
import logging
from myapp.celery_config import celery_app
from myapp.corporations.models import Corporation
logger = logging.getLogger()
@celery_app.task(
name='analytics.update_corporation_data',