<commit_before>hyloEnv.onUser(function(user) {

  // segment
  analytics.identify(user.id, {
    email: user.email,
    firstName: user.first_name,
    lastName: user.last_name,
    name: user.name,
    provider: user.linkedAccounts[0].provider_key,
    created: user.date_created
  }, {
    integrations: {
      Intercom: {
        user_hash: '<%= OpenSSL::HMAC.hexdigest("sha256", "fwnUBkiU2spjAlzNPDNCJhoI4iBQ66ap6XOnTznL", user.id) %>'
      }
    }
  });

  // rollbar
  _rollbarConfig.payload.person = {
    id: user.id,
    username: user.name,
    email: user.email
  };

  //intercom
  window.intercomSettings = {
    name: user.name,
    email: user.email,
    created_at: user.date_created,
    app_id: "wwelodje"
  };

(function(){
  var w=window;
  var ic=w.Intercom;
  if(typeof ic==="function"){
    ic('reattach_activator');
    ic('update',intercomSettings);
  }
  else {
    var d=document;
    var i=function() {
      i.c(arguments)
    };
    i.q=[];
    i.c=function(args) {
      i.q.push(args)
    };
    w.Intercom=i;
    function l(){
      var s=d.createElement('script');
      s.type='text/javascript';
      s.async=true;
      s.src='https://widget.intercom.io/widget/wwelodje';
      var x=d.getElementsByTagName('script')[0];
      x.parentNode.insertBefore(s,x);
    }
    if(w.attachEvent){
      w.attachEvent('onload',l);
    }
    else {
      w.addEventListener('load',l,false);
    }
  }
})()

});


window.fbAsyncInit = function() {
  FB.init({appId: hyloEnv.fb.appId, xfbml: true, version: 'v2.1'});
};

(function(d, s, id){
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/sdk.js";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

// Prevents backspace except in the case of textareas and text inputs to prevent user navigation.<commit_msg>add secure key for intercom<commit_after>hyloEnv.onUser(function(user) {

  // segment
  analytics.identify(user.id, {
    email: user.email,
    firstName: user.first_name,
    lastName: user.last_name,
    name: user.name,
    provider: user.linkedAccounts[0].provider_key,
    created: user.date_created
  });

  // rollbar
  _rollbarConfig.payload.person = {
    id: user.id,
    username: user.name,
    email: user.email
  };

  //intercom
  window.intercomSettings = {
    name: user.name,
    email: user.email,
    created_at: user.date_created,
    app_id: "wwelodje",
    user_hash:  'hash_hmac("sha256", $user->email, "wn5VnqcseKp5ihXlonHGmvukuI9R4HSb34K6CFFo")'
  };

  (function(){
    var w=window;
    var ic=w.Intercom;
    if(typeof ic==="function"){
      ic('reattach_activator');
      ic('update',intercomSettings);
    }
    else {
      var d=document;
      var i=function() {
        i.c(arguments)
      };
      i.q=[];
      i.c=function(args) {
        i.q.push(args)
      };
      w.Intercom=i;
      function l(){
        var s=d.createElement('script');
        s.type='text/javascript';
        s.async=true;
        s.src='https://widget.intercom.io/widget/wwelodje';
        var x=d.getElementsByTagName('script')[0];
        x.parentNode.insertBefore(s,x);
      }
      if(w.attachEvent){
        w.attachEvent('onload',l);
      }
      else {
        w.addEventListener('load',l,false);
      }
    }
  })()

});


window.fbAsyncInit = function() {
  FB.init({appId: hyloEnv.fb.appId, xfbml: true, version: 'v2.1'});
};

(function(d, s, id){
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/sdk.js";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

// Prevents backspace except in the case of textareas and text inputs to prevent user navigation.
{'fraction_non_alphanumeric': 0.1643835616438356, 'fraction_numerical': 0.00723701214784182, 'mean_word_length': 2.873873873873874, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '2528440', 'n_tokens_mistral': 1461, 'n_tokens_neox': 1444, 'n_words': 233}