This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is modified version of https://github.com/infinitered/phoenix_base/blob/master/lib/phoenix_base/maybe.ex | |
# | |
# Discussion https://elixirforum.com/t/maybe-nil-protection-for-nested-structs/468/8 | |
# The reason behind adding maybe https://elixirforum.com/t/elixir-version-of-a-safe-navigation-operator-navigating-nil-in-maps-structs/6023/7 | |
# Why Access Protocol is not implemented for struct: https://github.com/elixir-lang/elixir/issues/2973 | |
# | |
defmodule Streamgard.Utils.Maybe do | |
@moduledoc """ | |
## Example | |
import Maybe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in `find . -name 'Main-picture'`; do mv -v "$f" "`echo $f | tr '[A-Z]' '[a-z]'`"; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Store level | |
class ApplicationController | |
class FeatureException < StandardError; end | |
rescue_from FeatureException do |err| | |
redirect_to website_dashboard_path, alert: err.message | |
end | |
def authorize_feature!(name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# support/pages/organization_pages/estimate_index_page.rb:21 | |
require_relative '../page_object' | |
module OrganizationPages | |
class EstimateIndexPage < PageObject | |
def self.visit(subdomain) | |
navigate '/estimates', subdomain: subdomain | |
new | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module A | |
hello = proc { self } | |
define_method :method do | |
puts hello.call | |
end | |
# def self.included(base) | |
# this = self | |
# base.instance_eval do |