Skip to content

Instantly share code, notes, and snippets.

View matsumonkie's full-sized avatar

iori matsumonkie

View GitHub Profile
@ChrisPenner
ChrisPenner / Optics Cheatsheet.md
Last active April 12, 2024 14:24
Optics Cheatsheet
@chrisdone
chrisdone / HoleyMonoid.hs
Last active November 7, 2015 10:51
HoleyMonoid monoid!
{-# LANGUAGE FlexibleInstances #-}
-- | Monoids with holes. The 'HoleyMonoid' allows building monoidal values of which certain components are to be filled in later. For example:
--
-- > > let holey = now "x = "
-- > . later show
-- > . now ", y = "
-- > . later show
-- > > run holey 3 5
-- > "x = 3, y = 5"
--
@justinweiss
justinweiss / filterable.rb
Last active January 11, 2024 07:28
Filterable
# Call scopes directly from your URL params:
#
# @products = Product.filter(params.slice(:status, :location, :starts_with))
module Filterable
extend ActiveSupport::Concern
module ClassMethods
# Call the class methods with names based on the keys in <tt>filtering_params</tt>
# with their associated values. For example, "{ status: 'delayed' }" would call