<commit_before>class User < ActiveRecord::Base
  def self.from_omniauth(auth)
    where(auth.slice(:provider, :uid)).first_or_initialize.tap do |user|
      user.provider = auth.provider
      user.uid = auth.uid
      user.email = auth.info.email
      user.full_name = auth.info.name
      user.first_name = auth.info.first_name
      user.last_name = auth.info.last_name
      user.image = auth.info.image
      user.gender = auth.extra.raw_info.gender
      user.link = auth.extra.raw_info.link
      user.oauth_token = auth.credentials.token
      user.oauth_expires_at = Time.at(auth.credentials.expires_at)
      user.save!
      end
  end
end

# gb = Gibbon::API.new('7bad2873c41bfeed2adb6c88e4c54f96-us3')
#       list_id = 'aa300ad26a'
#       gb.lists.subscribe({:id => list_id, :email => {:email => user.email}, :merge_vars => {:FNAME => user.first_name, :LNAME => user.last_name, :GENDER => user.gender}, :double_optin => true})
      <commit_msg>fixing mailchimp + fb<commit_after>class User < ActiveRecord::Base
  def self.from_omniauth(auth)
    where(auth.slice(:provider, :uid)).first_or_initialize.tap do |user|
      user.provider = auth.provider
      user.uid = auth.uid
      user.email = auth.info.email
      user.full_name = auth.info.name
      user.first_name = auth.info.first_name
      user.last_name = auth.info.last_name
      user.image = auth.info.image
      user.gender = auth.extra.raw_info.gender
      user.link = auth.extra.raw_info.link
      user.oauth_token = auth.credentials.token
      user.oauth_expires_at = Time.at(auth.credentials.expires_at)
      user.save!
      if User.where(:uid => auth.uid).blank?
      gb = Gibbon::API.new('7bad2873c41bfeed2adb6c88e4c54f96-us3')
      list_id = 'aa300ad26a'
      gb.lists.subscribe({:id => list_id, :email => {:email => user.email}, :merge_vars => {:FNAME => user.first_name, :LNAME => user.last_name, :GENDER => user.gender}, :double_optin => true})
    else
    end
    end
  end
end
{'fraction_non_alphanumeric': 0.13282828282828282, 'fraction_numerical': 0.022222222222222223, 'mean_word_length': 3.127083333333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3260352', 'n_tokens_mistral': 732, 'n_tokens_neox': 701, 'n_words': 113}