Skip to content

Instantly share code, notes, and snippets.

View gnfisher's full-sized avatar
🧑‍🚀

Greg Fisher gnfisher

🧑‍🚀
View GitHub Profile
@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 / ubuntu-setup
Last active October 18, 2017 23:38
Ubuntu setup
# Capslock? pshaw.
setxkbmap -option ctrl:nocaps
# Lets get to it
sudo apt-get update
# install a bunch of build and dev libraries
sudo apt-get install build-essential libpq-dev libssl-dev libyaml-dev libreadline6-dev \
zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev
@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

map2 : (a -> b -> c) -> Validatable a -> Validatable b -> Validatable c
map2 func v1 v2 =
case ( v1, v2 ) of
( Invalid a fatal warnings, Valid b ) ->
Invalid (func a b) fatal warnings
( Invalid a fa wa, Warnings b wb ) ->
Invalid (func a b) fa (wa ++ Nonempty.toList wb)
( Invalid a fa wa, Invalid b fb wb ) ->
@gnfisher
gnfisher / Elm.md
Last active November 8, 2019 17:00
@gnfisher
gnfisher / dotfiles
Last active March 17, 2020 18:12
Dotfiles
=== zshrc
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=10000
setopt appendhistory autocd extendedglob
unsetopt beep
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
@gnfisher
gnfisher / modeling_forms_types.md
Last active June 1, 2020 22:36
Forms, Validations, and Static Types

Forms, Validations, and Static Types

Pitch your talk to the audience

Elm is a statically typed language that allows us to make impossible states impossible. But for those newer to Elm it isn't always obvious how to use this super power to solve their practical problems.

If you are still feeling a bit unsure yourself then join us as we use types to

@gnfisher
gnfisher / modern-ruby-rails-resources.md
Last active August 24, 2022 12:59
Modern Ruby on Rails Resources

Modern Ruby and Rail Resources

Hotwire