<commit_before>var config = {
    api_location: "//localhost:8000",
    lang: 'en',
};

module.exports = {
    get: function(k) { return config[k]; },
    set: function(k, v) {
        config[k] = v;
        if (k.indexOf('forever.') === 0) {
            console.log(k, v);
            localStorage[k] = v;
        }
    },
    remove: function(k) {
        localStorage.removeItem(k);
    },
}

var $ = require('jquery');
$(function($){
    $.getJSON('../config.json', function(data) {
        $.extend(config, data);
        for (var k in localStorage) {
            if (localStorage.hasOwnProperty(k)) {
                config[k] = localStorage[k];
            }
        }<commit_msg>Try to figure out where config.json is on the fly<commit_after>var config = {
    api_location: "//localhost:8000",
    lang: 'en',
};

module.exports = {
    get: function(k) { return config[k]; },
    set: function(k, v) {
        config[k] = v;
        if (k.indexOf('forever.') === 0) {
            console.log(k, v);
            localStorage[k] = v;
        }
    },
    remove: function(k) {
        localStorage.removeItem(k);
    },
}

var $ = require('jquery');
$(function($){
    var config_url = document.location.pathname + 'config.json';
    $.getJSON(config_url, function(data) {
        $.extend(config, data);
        for (var k in localStorage) {
            if (localStorage.hasOwnProperty(k)) {
                config[k] = localStorage[k];
            }
        }
{'fraction_non_alphanumeric': 0.16950306330837303, 'fraction_numerical': 0.0068073519400953025, 'mean_word_length': 2.012295081967213, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7204130', 'n_tokens_mistral': 484, 'n_tokens_neox': 474, 'n_words': 97}