Skip to content

Instantly share code, notes, and snippets.

View peterellisjones's full-sized avatar

Peter Jones peterellisjones

View GitHub Profile
@peterellisjones
peterellisjones / rotate_certs.rb
Last active February 19, 2020 11:22
BOSH-generated certificate rotation script
#!/usr/bin/env ruby
require 'yaml'
require 'json'
#
# Simple Ruby script to rotate bosh-generated certificates
# Requires a BOSH deployment manifest that uses certificate variables and the original credentials file
# Outputs 4 credentials files that should be deployed one at a time, in order
#
@peterellisjones
peterellisjones / app_instance_identity_intro_to_envoy.md
Created January 18, 2022 14:29 — forked from nikhilsuvarna/app_instance_identity_intro_to_envoy.md
Application Instance Identity and Intro to Envoy in PCF
@peterellisjones
peterellisjones / Chess Perft test positions
Last active January 31, 2024 02:21
Test positions for debugging chess engines. Formatted as JSON array of FEN strings
[
{
"depth":1,
"nodes":8,
"fen":"r6r/1b2k1bq/8/8/7B/8/8/R3K2R b KQ - 3 2"
},
{
"depth":1,
"nodes":8,
"fen":"8/8/8/2k5/2pP4/8/B7/4K3 b - d3 0 3"
@peterellisjones
peterellisjones / enumerable_functional_extensions.rb
Last active February 12, 2024 07:15
Some extensions to Ruby's Enumerable class to allow some fancy functional programming. More info here: http://ukoki.com/post/38615453403/extending-rubys-enumerable
#
# Extensions to Enumerable to add more functional operators
# More info here: http://ukoki.com/post/38615453403/extending-rubys-enumerable
#
module Enumerable
# example:
# [1,2,3].zip_map([1,2,3], [1,2,3]) { |x,y,z| x * y * z }
# => [1,8,27]