<commit_before>export function generatePixelDrawCss(pixelGrid, columns, rows, cellSize) {
  let cssString = pixelGrid.reduce((accumulator, currentValue, i) => {
    if (currentValue.used) {
      let xCoord = ((i % columns) * cellSize) + cellSize;
      let yCoord = (parseInt(i / columns, 10) * cellSize) + cellSize;

      return accumulator +
        ' ' +
        (xCoord + 'px ') +
        (yCoord + 'px')
        + ' 0 '
        + '#' + currentValue.color
        + ',';
    } else {
      return accumulator;
    }
  }, '');
  return cssString;
}

export function shareDrawing(cssImageData, columns, rows, cellSize, text) {
  let cssParsedData = cssImageData.split(',').filter(
      function(elem){
        return elem !== ''
      }).map(
        function(elem){
          if (elem !== '') {
            return elem.trim().split(' ').reduce(
              function(acum, elem){
                acum.push(elem.split('px').shift());
                return acum;
              },
              [])
          }
        }
      );

  var css =  {
      'cols': columns,
      'rows': rows,
      'pixelSize': cellSize,
      'boxShadow': cssParsedData,
      'text': text
    };

  $.ajax({
    method: "POST",
    // url: "http://127.0.0.1:3000/auth/twitter",
    url: "http://pixelart-to-css-react.herokuapp.com/auth/twitter",
    data: css
  }).done(function(data) {
    window.location = data;
  });
}<commit_msg>absolute twitter path changed by relative<commit_after>export function generatePixelDrawCss(pixelGrid, columns, rows, cellSize) {
  let cssString = pixelGrid.reduce((accumulator, currentValue, i) => {
    if (currentValue.used) {
      let xCoord = ((i % columns) * cellSize) + cellSize;
      let yCoord = (parseInt(i / columns, 10) * cellSize) + cellSize;

      return accumulator +
        ' ' +
        (xCoord + 'px ') +
        (yCoord + 'px')
        + ' 0 '
        + '#' + currentValue.color
        + ',';
    } else {
      return accumulator;
    }
  }, '');
  return cssString;
}

export function shareDrawing(cssImageData, columns, rows, cellSize, text) {
  let cssParsedData = cssImageData.split(',').filter(
      function(elem){
        return elem !== ''
      }).map(
        function(elem){
          if (elem !== '') {
            return elem.trim().split(' ').reduce(
              function(acum, elem){
                acum.push(elem.split('px').shift());
                return acum;
              },
              [])
          }
        }
      );

  var css =  {
      'cols': columns,
      'rows': rows,
      'pixelSize': cellSize,
      'boxShadow': cssParsedData,
      'text': text
    };

  $.ajax({
    method: "POST",
    // url: "http://127.0.0.1:3000/auth/twitter",
    url: "/auth/twitter",
    data: css
  }).done(function(data) {
    window.location = data;
  });
}
{'fraction_non_alphanumeric': 0.16195190947666196, 'fraction_numerical': 0.009193776520509194, 'mean_word_length': 1.9316062176165802, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4361604', 'n_tokens_mistral': 908, 'n_tokens_neox': 879, 'n_words': 181}