<commit_before>jQuery(function() { // Wait for jQuery

  var isFileSaverSupported = init();

  // Create a little duck translator
  Duck = new Dckuinojs();

  $(".compile-but").click(function(e) {
    var duckOutput = Duck.toArduino($(".duckyscript").val());

    if (duckOutput !== false)
    {
      $(".arduino").val(duckOutput);
      if (isFileSaverSupported)
        $(".dl-but").prop('disabled', false);
    }
    else {
      $(".arduino").val('Error, please see console...');
      $(".dl-but").prop('disabled', true);
    }
  });

  // Download button
  $(".dl-but").click(function(e) {
    // Create a zip and download
    var sketchName = "iLoveDuck-" + makeId(4);

    var zipHandler = new JSZip();
    zipHandler.file(sketchName + "/" + sketchName + ".ino", $(".arduino").val());
    zipHandler.file("readme", $.ajax({
      url: 'readme.default',
      type: 'post',
      success: function(data) {return data;}
    }));
    zipHandler.generateAsync({type:"blob"})
      .then(function(content) {
        saveAs(content, sketchName + ".zip");
      }
    );
  });
});

function init()
{
  // Init page
  $(".dl-but").prop('disabled', true); // Disable download button by default

  // Check if download button can be used
  try {
    return !!new Blob;
  } catch (e) {}
}

function makeId(idLenght)
{
  var text = "";
  var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

  for( var i=0; i < idLenght; i++ )
    text += possible.charAt(Math.floor(Math.random() * possible.length));

  return text;
}
<commit_msg>Modified to fit with gh page limits<commit_after>jQuery(function() { // Wait for jQuery

  var isFileSaverSupported = init();

  // Create a little duck translator
  Duck = new Dckuinojs();

  $(".compile-but").click(function(e) {
    var duckOutput = Duck.toArduino($(".duckyscript").val());

    if (duckOutput !== false)
    {
      $(".arduino").val(duckOutput);
      if (isFileSaverSupported)
        $(".dl-but").prop('disabled', false);
    }
    else {
      $(".arduino").val('Error, please see console...');
      $(".dl-but").prop('disabled', true);
    }
  });

  // Download button
  $(".dl-but").click(function(e) {
    // Create a zip and download
    var sketchName = "iLoveDuck-" + makeId(4);

    var zipHandler = new JSZip();
    zipHandler.file(sketchName + "/" + sketchName + ".ino", $(".arduino").val());
    zipHandler.file("readme", $.ajax({
      url: 'readme.default',
      type: 'get',
      success: function(data) {return data;}
    }));
    zipHandler.generateAsync({type:"blob"})
      .then(function(content) {
        saveAs(content, sketchName + ".zip");
      }
    );
  });
});

function init()
{
  // Init page
  $(".dl-but").prop('disabled', true); // Disable download button by default

  // Check if download button can be used
  try {
    return !!new Blob;
  } catch (e) {}
}

function makeId(idLenght)
{
  var text = "";
  var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

  for( var i=0; i < idLenght; i++ )
    text += possible.charAt(Math.floor(Math.random() * possible.length));

  return text;
}

{'fraction_non_alphanumeric': 0.1850079744816587, 'fraction_numerical': 0.007655502392344498, 'mean_word_length': 2.9646017699115044, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6464631', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1052, 'n_words': 228}