Skip to content

Instantly share code, notes, and snippets.

View Winslett's full-sized avatar

Christopher Winslett Winslett

View GitHub Profile
#!/bin/sh
# branch from https://gist.github.com/pozorvlak/8784840
# Suppose you want to do blind reviewing of code (eg for job interview
# purposes). Unfortunately, the candidates' names and email addresses are
# stored on every commit! You probably want to assess each candidate's version
# control practices, so just `rm -rf .git` throws away too much information.
# Here's what you can do instead.
@Winslett
Winslett / keybase.md
Created April 27, 2018 12:37
keybase.md

Keybase proof

I hereby claim:

  • I am winsletts on github.
  • I am winslett (https://keybase.io/winslett) on keybase.
  • I have a public key ASC1e7be3Ddlb0sI7WSEbwpbzvy92l8XsnBdb1qyRZe5RQo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am winsletts on github.
  • I am winslett (https://keybase.io/winslett) on keybase.
  • I have a public key ASC1e7be3Ddlb0sI7WSEbwpbzvy92l8XsnBdb1qyRZe5RQo

To claim this, I am signing this object:

#!/usr/bin/env ruby
# construct the array of possibilities
def construct_board(board)
unknown_count = 0
board.each_with_index do |row, row_index|
row.each_with_index do |cell_value, column_index|
if cell_value.nil?
board[row_index][column_index] = (1..9).to_a
@Winslett
Winslett / projects.zsh
Last active October 11, 2024 11:10
Pretty Project Directories
compdef _p p
function _p () {
_files -W /Users/`whoami`/Projects/ -
return 1
}
function p () {
if [[ $1 == 'open' ]]; then
REPLACEMENT="s/\\/Users\\/`whoami`\\/Projects\\///g"
@Winslett
Winslett / gist:aafee479257bc64ba5db8d11191ec842
Last active February 6, 2021 02:17
Fun quote opposite-word algorithm
if you are too FALSE to do the TRUE things, then you are too TRUE to do the FALSE things.
if you are too TRUE to do the FALSE things, then you are too FALSE to do the TRUE things.
if you are too above to do the below things, then you are too below to do the above things.
if you are too absent to do the present things, then you are too present to do the absent things.
if you are too abundant to do the scarce things, then you are too scarce to do the abundant things.
if you are too accept to do the decline things, then you are too decline to do the accept things.
if you are too accept to do the refuse things, then you are too refuse to do the accept things.
if you are too accidental to do the intentional things, then you are too intentional to do the accidental things.
if you are too accurate to do the inaccurate things, then you are too inaccurate to do the accurate things.
if you are too admit to do the deny things, then you are too deny to do the admit things.
SELECT
total_exec_time,
mean_exec_time AS avg_ms,
calls,
query
FROM pg_stat_statements
ORDER BY mean_exec_time DESC
LIMIT 10;
@Winslett
Winslett / Blog.md
Last active June 7, 2022 15:42
Database Performance is all about costs

Stick with Simplicity to Cross the Database Financial Gap

TL;DR: keep your data-layer simple, you’ll need the agility it offers when budgets get stretched.

Over the past 12 years of helping people run databases for their businesses, I have discovered that there are only 2 financial phases in the lifecycle of a database:

  • Phase 1: Absolute costs are low, thus marginal costs do not matter.
  • Phase 2: Absolute costs are high, thus marginal costs are all that matter.

I'm calling this difference between Phase 1 and Phase 2 the "database financial gap."

@Winslett
Winslett / 1-programmer-bookshelf.png
Last active May 5, 2022 20:59
Demystifying Database Performance for Developers
1-programmer-bookshelf.png
@Winslett
Winslett / 1-terminal-slow-queries.png
Last active May 16, 2022 14:24
Use SQL comments as a Stacktrace for database performance
1-terminal-slow-queries.png