Skip to content

Instantly share code, notes, and snippets.

@tpo
tpo / understanding_patroni.md
Last active Jun 11, 2020
understanding patroni
View understanding_patroni.md

There are two fundamental stages in Patroni:

  • bootstrap
  • running the cluster

Bootstrap stage

In the bootstrap stage, Patroni will:

@tpo
tpo / 31c3 presentation reviews.md
Last active Jan 1, 2016
Reviews der Präsentationen am 31. Chaos Computer Congress (31c3) - 2014
View 31c3 presentation reviews.md
@tpo
tpo / autodefine.rb
Last active Aug 29, 2015
define? considered evil
View autodefine.rb
#!/usr/bin/ruby
# tested with ruby 1.9.3p194
puts "this will not print" if defined?(x)
if false
puts "this neither"
x = "foobar"
end
@tpo
tpo / Pascals_WITH.rb
Created Mar 7, 2011
Pascal's WITH in ruby
View Pascals_WITH.rb
# for a long time I wondered why Ruby didn't have Pascal's "WITH"
# construct. It's completely trivial to implent though...
def with object, &block
object.instance_eval(&block)
end
# now instead of needing to name your object all the time:
object = Object.new