<commit_before>// Licensed "AS IF" by <NAME> (June 7, 2012)
// Automatic textarea resizing
//  - Dependency = throttle (and assumes twitter bootstrap css)
$.fn.textarea = function() {
  return this.each(function() {
    var holder = $('<div class="span6"></div>')
      .css({'display':'none', 'text-align':'justify'})
      .appendTo('body');
      
    $(this)
      .after('<span id="scroll_me"><span>')
      .css('overflow', 'hidden')
      .keyup($.throttle(250, resize));
    
    function resize() {
      holder.html(
        this.value
          .replace(/</g, '&lt;')
          .replace(/\n/g, '<br>')
      );

      var current = $(this).height();
      var real    = holder.height()+5;
      
      if (current < real || real-20 < current)
        $(this).css('height', real).stop(true, true).animate({height:real+10}, 140);
    }
    
  });
};<commit_msg>Textarea resizer (met throttle.js)<commit_after>// Licensed "AS IF" by <NAME> (June 7, 2012)
// Automatic textarea resizing
//  - Dependency = throttle (and assumes twitter bootstrap css)
$.fn.flexible = function() {  
  return this.each(function() {
    var holder = $('<div class="span6"></div>')
      .css({'display':'none'})
      .appendTo('body');
 
    $(this)
      .keyup($.throttle(40, resize))
      .resize(); // resize on startup
    
    function resize() {
      holder.html( '<br>' + this.value.replace(/</g, '&lt;').replace(/\n/g, '<br>') + '<br>');
      $(this).css('height', holder.height());
    }
  });
};
{'fraction_non_alphanumeric': 0.21428571428571427, 'fraction_numerical': 0.016688918558077435, 'mean_word_length': 2.612048192771084, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 15, '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': '5375637', 'n_tokens_mistral': 537, 'n_tokens_neox': 488, 'n_words': 109}