Skip to content

Instantly share code, notes, and snippets.

View synth's full-sized avatar

Peter Philips synth

View GitHub Profile
@synth
synth / flag_registration.rb
Created February 14, 2024 06:33
Feature flag code detection
module Flipper
module FlagRegistration
# These functions are all memoized because they should be static for the
# lifetime of a deployment (albeit they are really static to a Ruby process)
def self.registered_flags
@registered_flags ||= YAML.load_file("config/feature_flags.yml")
end
def self.flags_in_code
@flags_in_code ||= begin
@synth
synth / slack_markdown_converter.rb
Created May 17, 2025 05:40
Html to Slack Markdown Converter
require 'nokogiri'
class SlackMarkdownConverter
class << self
def convert(html, options = {})
converter = new(options)
converter.convert(html)
end
end