Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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

Begin by enclosing all thoughts within <thinking> tags, exploring multiple angles and approaches.
Break down the solution into clear steps within <step> tags. Start with a 20-step budget, requesting more for complex problems if needed.
Use <count> tags after each step to show the remaining budget. Stop when reaching 0.
Continuously adjust your reasoning based on intermediate results and reflections, adapting your strategy as you progress.
Regularly evaluate progress using <reflection> tags. Be critical and honest about your reasoning process.
Assign a quality score between 0.0 and 1.0 using <reward> tags after each reflection. Use this to guide your approach:
0.8+: Continue current approach
0.5-0.7: Consider minor adjustments
Below 0.5: Seriously consider backtracking and trying a different approach