Skip to content

Instantly share code, notes, and snippets.

@kennyfrc
kennyfrc / railway_oriented_programming_in_ruby.rb
Last active March 3, 2023 16:22
Ruby Example of Railway Oriented Programming
require 'json'
##
# Combinator module
# contains .map, .bind, .apply, .compose
# a toolkit for building functional programs
##
module Combinator
Result = Data.define(:success, :error, :value) do
def call(&block)
@kennyfrc
kennyfrc / checkout_fb_pixel
Created September 10, 2017 05:10
facebook checkout purchase tracking code
<script>
fbq('track', 'Purchase', {value: {{ total_price | money_without_currency }}, currency: {{ shop.currency }}});
</script>