<commit_before>(function() {
	'use strict';

	$(document).ready(function() {
		try
		{
			readHeader();
			readContainer();
			readFooter();
		}
		catch(ex)
		{
			console.log(ex);
		}
	});

	var readHeader = function()
	{
		compositionsReader($('[data-composition=header]'));
	};

	var readFooter = function()
	{
		compositionsReader($('[data-composition=footer]'));
	};

	var compositionsReader = function($elToReplace)
	{
		var $expectedElementPlace = $elToReplace;
		
		if($expectedElementPlace.length > 0)
		{
			var fileName = $expectedElementPlace.attr('data-composition');
			if(fileName !== '')
			{
				var fileEmplacement = 'compositions/' + fileName + '.html';
				$.ajax({
					url: fileEmplacement,
					type: 'GET',
					success: function(data) {
						$expectedElementPlace.replaceWith(data);
					}
				});
			}
		}
	};

	var readContainer = function()
	{
		var $elContainer = $('[data-composition=container]');

		var type = $elContainer.attr('data-type');

		// edit IIS config value <directoryBrowse enabled="true" />
		if(type === 'blog')
		{
			var postsEmplacement = 'content/posts/';
			var allPosts = undefined;
			$.ajax({
				url: postsEmplacement,
				type: 'GET',
				success: function(data) {
					allPosts = data;

					// test with IIS server
					if(allPosts !== undefined)
					{
						allPosts = $(data).find('a');
						// first el is parent directory
						if(allPosts.length > 1)
						{
							for (var i = allPosts.length - 1; i >= 1; i--) {
								var postUrl = $(allPosts[i]).attr('href');
								if(postUrl.length > 0)
								{
									postsReader($elContainer, postUrl);
								}
							}
						}
					}
				}
			});		
		}
	};

	var postsReader = function($elContainer, postUrl)
	{
		$.ajax({
			url: postUrl,
			type: 'GET',
			success: function(data) {
				$elContainer.append(data);
			}
		});
	};
})();<commit_msg>Read posts directly on Github folder<commit_after>(function() {
	'use strict';

	$(document).ready(function() {
		try
		{
			readHeader();

			// 
			var useGithub = true;
			var githubUsername = 'azerato';
			readContainer(useGithub);
			

			readFooter();
		}
		catch(ex)
		{
			console.log(ex);
		}
	});

	var readHeader = function()
	{
		compositionsReader($('[data-composition=header]'));
	};

	var readFooter = function()
	{
		compositionsReader($('[data-composition=footer]'));
	};

	var compositionsReader = function($elToReplace)
	{
		var $expectedElementPlace = $elToReplace;
		
		if($expectedElementPlace.length > 0)
		{
			var fileName = $expectedElementPlace.attr('data-composition');
			if(fileName !== '')
			{
				var fileEmplacement = 'compositions/' + fileName + '.html';
				$.ajax({
					url: fileEmplacement,
					type: 'GET'
				}).success(function(data) {
					$expectedElementPlace.replaceWith(data);
				});
			}
		}
	};

	var readContainer = function(useGithub, githubUsername)
	{
		var $elContainer = $('[data-composition=container]');

		var type = $elContainer.attr('data-type');

		if(type === 'blog')
		{
			var postsEmplacement = 'content/posts/';
			if(useGithub === true && useGithub !== undefined && githubUsername !== '' && githubUsername !== undefined)
			{
				var postsEmplacement = 'https://api.github.com/repos/' + githubUsername +'/' 
							+ githubUsername + '.github.io/contents/' 
							+ postsEmplacement;

				$.ajax({
					url: postsEmplacement,
					type: 'GET',
					dataType: 'jsonp'
				}).success(function(results) {
					if(results !== undefined)
					{
						allPosts = results.data;
						// first el is parent directory
						if(allPosts.length > 0)
						{
							for (var i = allPosts.length - 1; i >= 1; i--) {
								var postUrl = allPosts[i].download_url;
								if(postUrl.length > 0)
								{
									postsReader($elContainer, postUrl);
								}
							}
						}
					}
				});
			}
			else
			{
				// edit IIS config value <directoryBrowse enabled="true" />	
				var allPosts = undefined;
				$.ajax({
					url: postsEmplacement,
					type: 'GET'
				}).success(function(data) {
					allPosts = data;

					// test with IIS server
					if(allPosts !== undefined)
					{
						allPosts = $(data).find('a');
						// first el is parent directory
						if(allPosts.length > 1)
						{
							for (var i = allPosts.length - 1; i >= 1; i--) {
								var postUrl = $(allPosts[i]).attr('href');
								if(postUrl.length > 0)
								{
									postsReader($elContainer, postUrl);
								}
							}
						}
					}
				});
			}
		}
	};

	var postsReader = function($elContainer, postUrl)
	{
		$.ajax({
			url: postUrl,
			type: 'GET'
		}).success(function(data) {
			$elContainer.append(data);
		});
	};
})();
{'fraction_non_alphanumeric': 0.1647641611027353, 'fraction_numerical': 0.0030152918371742408, 'mean_word_length': 2.5288753799392096, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5302357', 'n_tokens_mistral': 2108, 'n_tokens_neox': 1510, 'n_words': 292}