<commit_before>var express = require('express');
var morgan  = require('morgan')
var colors = require('./colors.js');
var argv = require('minimist')(process.argv.slice(2));

var port = process.env.PORT || parseInt(argv['port'] || 3004);
var size = parseInt(argv['size'] || 26);
var s = parseFloat(argv['s'] || 0.8);
var v = parseFloat(argv['v'] || 0.8);
var seed = parseFloat(argv['seed'] || 0.8);
var defaultPalette = colors.palette(size, seed, s, v)


var app = express();
app.set('view engine', 'ejs');
app.use(morgan())

app.get('/avatar/:id(\\d+)/:initials(\\w{1,2})', function(req, res){
  var color = defaultPalette[req.params.id % defaultPalette.length] 
  var initials = req.params.initials.toUpperCase();
  res.setHeader("Content-Type", "image/svg+xml");
  res.render('svg', { color:color, text:initials })
});

app.get("/colors", function(req, res){
  res.render('colors', { palette:defaultPalette })
})

app.get('/', function(req, res){
  res.render('home')
})

console.log('Sqwiggle Avatars Listening On Port: ' + port)
console.log('Default Palette Size: ' + size)
console.log('Default Seed Value: ' + seed)
console.log('Default Saturation Value: ' + s)
console.log('Default Hue Value: ' + v)
app.listen(port);
<commit_msg>dot svg<commit_after>var express = require('express');
var morgan  = require('morgan')
var colors = require('./colors.js');
var argv = require('minimist')(process.argv.slice(2));

var port = process.env.PORT || parseInt(argv['port'] || 3004);
var size = parseInt(argv['size'] || 26);
var s = parseFloat(argv['s'] || 0.8);
var v = parseFloat(argv['v'] || 0.8);
var seed = parseFloat(argv['seed'] || 0.8);
var defaultPalette = colors.palette(size, seed, s, v)


var app = express();
app.set('view engine', 'ejs');
app.use(morgan())

app.get('/avatar/:id(\\d+)/:initials(\\w{1,2}).svg', function(req, res){
  var color = defaultPalette[req.params.id % defaultPalette.length] 
  var initials = req.params.initials.toUpperCase();
  res.setHeader("Content-Type", "image/svg+xml");
  res.render('svg', { color:color, text:initials })
});

app.get("/colors", function(req, res){
  res.render('colors', { palette:defaultPalette })
})

app.get('/', function(req, res){
  res.render('home')
})

console.log('Sqwiggle Avatars Listening On Port: ' + port)
console.log('Default Palette Size: ' + size)
console.log('Default Seed Value: ' + seed)
console.log('Default Saturation Value: ' + s)
console.log('Default Hue Value: ' + v)
app.listen(port);

{'fraction_non_alphanumeric': 0.21093117408906883, 'fraction_numerical': 0.012145748987854251, 'mean_word_length': 5.319693094629156, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '837625', 'n_tokens_mistral': 890, 'n_tokens_neox': 871, 'n_words': 187}