Skip to content

Instantly share code, notes, and snippets.

View daslicious's full-sized avatar

Damien daslicious

View GitHub Profile
{"Acura":{"MDX":{"years":["2001","2002","2003","2004","2005","2006","2007","2008","2009","2010","2011","2012","2013","2014","2015","2016","2017","2018","2019","2020","2022","2023"]},"RDX":{"years":["2007","2008","2009","2010","2011","2012","2013","2014","2015","2016","2017","2018","2019","2020","2021","2022","2023"]},"RL":{"years":["1996","1997","1998","1999","2000","2001","2002","2003","2004","2005","2006","2007","2008","2009","2010","2011","2012"]},"TL":{"years":["1995","1996","1997","1998","1999","2000","2001","2002","2003","2004","2005","2006","2007","2008","2009","2010","2011","2012","2013","2014"]},"TSX":{"years":["2004","2005","2006","2007","2008","2009","2010","2011","2012","2013","2014"]},"ZDX":{"years":["2010","2011","2012","2013"]},"Integra":{"years":["1992","1993","1994","1995","1996","1997","1998","1999","2000","2001","2023"]},"NSX":{"years":["1992","1993","1994","1995","1996","1997","1998","1999","2000","2001","2002","2003","2004","2005","2017","2018","2019","2020","2021","2022"]},"SLX":{"years"
@daslicious
daslicious / email_cleanup.md
Created May 8, 2023 17:46
email cleanup script
# URI::MailTo::EMAIL_REGEXP adapted for postgres
EMAIL_REGEX = %Q(\\A[a-zA-Z0-9.!#$%&''*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\\Z)
POPULAR_DOMAINS = %w[gmail yahoo hotmail]

def pluck_email(relation)
  relation.pluck(Arel.sql(%Q(data->>'email')))
end

# before state
  1. Go to the business settings page for our business.
  2. Click pages in the left sidebar.
  3. Select the desired page from the list.
  4. Add our primary user to the list of "People".
  5. Copy the ID (circled in red) and paste it into the "Facebook Page ID" field.

facebook instructions

class Post < ActiveRecord::Base
has_many :comments
belongs_to :user
belongs_to :topic
default_scope { order(created_at: :desc) }
validates :title, :body, :topic, :user, presence: true
validates :title, length: { minimum: 5 }
validates :body, length: { minimum: 20 }