<commit_before>var AWS = require('aws-sdk')
var fs = require('fs')

AWS.config.update({
  accessKeyId: process.env.AWS_KEY,
  secretAccessKey: process.env.AWS_SECRET
})

var files = [
  'index.html',
  'nomnoml.css',
  'dist/nomnoml.web.js',
  'dist/webapp.js',
  'lib/dagre.min.js',
  'lib/filesaver.min.js',
  'lib/underscore.min.js',
  'lib/vue.min.js',
  'codemirror/codemirror-compressed.js',
  'codemirror/codemirror.css',
  'codemirror/nomnoml.codemirror-mode.js',
  'codemirror/solarized.nomnoml.css',
  'img/interaction-tutorial.svg',
]

var contentTypes = {
  js: 'application/javascript',
  css: 'text/css',
  html: 'text/html',
  svg: 'image/svg+xml',
}

var subfolder = process.argv[2]
subfolder = subfolder ? (subfolder + '/') : ''

function contentType(file){ return contentTypes[file.split('.').slice(-1)[0]] }

files.forEach(function (file){
  var base64data = Buffer.from(fs.readFileSync(file), 'binary')

  var s3 = new AWS.S3()
  s3.putObject({
    Bucket: 'www.nomnoml.com',
    Key: subfolder + file,
    Body: base64data,
    ContentType: contentType(file),
    ACL: 'public-read'<commit_msg>publish tests to www.nomnoml.com<commit_after>var AWS = require('aws-sdk')
var fs = require('fs')

AWS.config.update({
  accessKeyId: process.env.AWS_KEY,
  secretAccessKey: process.env.AWS_SECRET
})

var files = [
  'index.html',
  'nomnoml.css',
  'dist/nomnoml.web.js',
  'dist/webapp.js',
  'lib/dagre.min.js',
  'lib/filesaver.min.js',
  'lib/underscore.min.js',
  'lib/vue.min.js',
  'codemirror/codemirror-compressed.js',
  'codemirror/codemirror.css',
  'codemirror/nomnoml.codemirror-mode.js',
  'codemirror/solarized.nomnoml.css',
  'img/interaction-tutorial.svg',
  // test files
  'dist/nomnoml.js',
  'test/index.html',
  'test/nomnoml.spec.js',
  'test/output.node-test.svg',
  'test/skanaar.testsuite.js',
  'test/standalone.usecase.html',
]

var contentTypes = {
  js: 'application/javascript',
  css: 'text/css',
  html: 'text/html',
  svg: 'image/svg+xml',
}

var subfolder = process.argv[2]
subfolder = subfolder ? (subfolder + '/') : ''

function contentType(file){ return contentTypes[file.split('.').slice(-1)[0]] }

files.forEach(function (file){
  var base64data = Buffer.from(fs.readFileSync(file), 'binary')

  var s3 = new AWS.S3()
  s3.putObject({
    Bucket: 'www.nomnoml.com',
    Key: subfolder + file,
    Body: base64data,
    ContentType: contentType(file),
    ACL: 'public-read'
{'fraction_non_alphanumeric': 0.18155619596541786, 'fraction_numerical': 0.008233841086867023, 'mean_word_length': 4.04149377593361, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 3, 'xml': 2}, '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': '4761390', 'n_tokens_mistral': 996, 'n_tokens_neox': 982, 'n_words': 146}