I hereby claim:
- I am baldwindavid on github.
- I am baldwindavid (https://keybase.io/baldwindavid) on keybase.
- I have a public key whose fingerprint is 4F3A C424 8315 8EF6 3CC5 DCF1 E130 F0B0 D0D2 73C2
To claim this, I am signing this object:
alias g="git" | |
# Log | |
alias gl="gitx" | |
# Commit: Prepare Commit in Gitx (run gitx first to refresh) | |
alias gc="gitx; gitx -c" | |
# Checkout branch | |
alias gco="g checkout" |
class DependentPresenceValidator < ActiveModel::EachValidator | |
def validate_each(record, attribute, value) | |
dependents = [options[:dependents]].flatten | |
dependents.each do |dependent| | |
unless record.send(dependent).present? | |
record.errors.add dependent, "must not be blank when #{attribute.to_s.humanize} is present." | |
end |
I hereby claim:
To claim this, I am signing this object:
require 'rubygems' | |
require 'net/http' | |
require 'uri' | |
require 'json' | |
require 'cgi' | |
# Get a free API key at https://words.bighugelabs.com/account/getkey | |
API_KEY = '[YOUR API KEY HERE]' | |
API_VERSION = 2 | |
WORDS_PER_LINE = 4 |
module Pipe | |
# Calls a list of methods in succession (i.e. pipes through) | |
# Include the module in your class to prove the `pipe` method. | |
# | |
# Example: | |
# | |
# include Pipe | |
# | |
# def do_a_thing |
defmodule Elevate.Networking.NetworkUpdater do | |
alias Elevate.Networking.NetworkConnection, as: Connection | |
alias Elevate.Networking.SubnetBuilder | |
def disable_access( | |
user_id: user_id, | |
network_id: network_id, | |
vlan_only_id: vlan_only_id, | |
site_id: site_id | |
) do |
defmodule S3.DirectUpload do | |
import ExAws.Auth.Utils, only: [amz_date: 1] | |
import ExAws.S3.Utils | |
@default_max_size_kilobytes 5_242_880 | |
@default_expiry_seconds 3600 | |
@type canned_acl :: | |
:private | |
| :public_read |
defmodule Capturepipe do | |
@doc """ | |
A pipe-operator that extends the normal pipe | |
in one tiny way: | |
It allows the syntax of having a bare `&1` capture | |
to exist inside a datastructure as one of the pipe results. | |
This is useful to insert the pipe's results into a datastructure | |
such as a tuple. |
unit_statuses = | |
# There is a Unit schema that is tied to a "units" table | |
from(unit in Unit, | |
# grab a lease tied to a unit (office space) | |
# Leases have start and end dates so the lease must be during the week | |
# of the given `date`. This will scope leases to that requirement. | |
left_join: lease in ^Leasing.filter_active_leases_during_week(Lease, date), | |
on: lease.unit_id == unit.id, | |
# join the unit type (Salon, Office, Focus, etc) | |
join: unit_type in assoc(unit, :unit_type), |
############################################################ | |
# APP ROLES | |
############################################################ | |
def insert_app_super_admin_role, do: insert(:super_admin) |> Roles.role_for() | |
def insert_app_admin_role, do: insert(:admin) |> Roles.role_for() | |
def insert_app_marketer_role, do: insert(:marketer) |> Roles.role_for() | |
def insert_app_user_role, do: insert(:user) |> Roles.role_for() | |
def insert_all_app_roles, do: insert_app_roles(@roles) |