<commit_before><?php
header('Content-Type: text/javascript');
if ( strrpos( $_SERVER['REQUEST_URI'], 'no-cache' ) === FALSE ) {
	header("Expires: Thu, 31 Dec 2020 20:00:00 GMT");
} else {
	$pretty_modtime = gmdate('D, d M Y H:i:s', time() - 2000) . 'GMT'; 
	header("Last-Modified: $pretty_modtime"); 
	header("Expires: $pretty_modtime"); 
	header("Pragma: no-cache"); 
}
$subject = $_SERVER['REQUEST_URI'];
$pattern = '/\/sleep-(\d+)\//';
preg_match($pattern, $subject, $matches);
if (sizeof($matches) > 1) {
  sleep($matches[1]);
}

$name = explode('.', basename($_SERVER['REQUEST_URI'], '.js'));

echo 'window.' . $name[0] . 'time = (+new Date);';
echo 'window.' . $name[0] . ' = true;';<commit_msg>Tidy up javascript.php to handle query strings with decimals properly<commit_after><?php
header('Content-Type: text/javascript');
if ( strrpos( $_SERVER['REQUEST_URI'], 'no-cache' ) === FALSE ) {
	header("Expires: Thu, 31 Dec 2020 20:00:00 GMT");
} else {
	$pretty_modtime = gmdate('D, d M Y H:i:s', time() - 2000) . 'GMT'; 
	header("Last-Modified: $pretty_modtime"); 
	header("Expires: $pretty_modtime"); 
	header("Pragma: no-cache"); 
}
$subject = $_SERVER['REQUEST_URI'];
$pattern = '/\/sleep-(\d+)\//';
preg_match($pattern, $subject, $matches);
if (sizeof($matches) > 1) {
  sleep($matches[1]);
}

$name = basename(array_shift(explode('?', $_SERVER['REQUEST_URI'])), '.js');

echo 'window.' . $name . 'time = (+new Date);';
echo 'window.' . $name . ' = true;';
{'fraction_non_alphanumeric': 0.23959044368600682, 'fraction_numerical': 0.025938566552901023, 'mean_word_length': 5.108333333333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5968113', 'n_tokens_mistral': 583, 'n_tokens_neox': 537, 'n_words': 120}