Skip to content

Instantly share code, notes, and snippets.

View gnfisher's full-sized avatar
🧑‍🚀

Greg Fisher gnfisher

🧑‍🚀
View GitHub Profile
@gnfisher
gnfisher / elm-types-glossary.md
Created August 14, 2019 15:07 — forked from JoelQ/elm-types-glossary.md
Elm Type Glossary

Elm Types Glossary

There's a lot of type terminology and jargon going around when discussing types in Elm. This glossary attempts to list some of the most common type terms along with synonyms, terms from other language communities, examples, and links to more detailed articles on each topic.

Custom Type

These are the basic building blocks of data modeling in Elm. This used to be

@gnfisher
gnfisher / union_scope.rb
Created January 9, 2018 17:39 — forked from tlowrimore/union_scope.rb
Unions multiple scopes on a model, and returns an instance of ActiveRecord::Relation.
module ActiveRecord::UnionScope
def self.included(base)
base.send :extend, ClassMethods
end
module ClassMethods
def union_scope(*scopes)
id_column = "#{table_name}.#{primary_key}"
sub_query = scopes.map { |s| s.select(id_column).to_sql }.join(" UNION ")
where "#{id_column} IN (#{sub_query})"
@gnfisher
gnfisher / rxjs_operators_by_example.md
Created October 13, 2017 16:55 — forked from btroncone/rxjs_operators_by_example.md
RxJS 5 Operators By Example