<commit_before>window.env = require 'env'
window.utils = require 'utils'
window.constants = require 'constants'
window.app = require 'application'

# Make all string methods available on _
_.mixin _.string.exports()

# Set Vex default className
vex.defaultOptions.className = 'vex-theme-default'

# Patch jQuery ajax to always use xhrFields.withCredentials true
_oldAjax = jQuery.ajax
jQuery.ajax = (opts) ->
    opts.xhrFields ?= {}
    opts.xhrFields.withCredentials = true

    _oldAjax.call jQuery, opts

$ -> app.initialize()<commit_msg>Configure moment().calender() to be used as an alternative to moment().from()<commit_after>window.env = require 'env'
window.utils = require 'utils'
window.constants = require 'constants'
window.app = require 'application'

# Make all string methods available on _
_.mixin _.string.exports()

# Set Vex default className
vex.defaultOptions.className = 'vex-theme-default'

# Patch jQuery ajax to always use xhrFields.withCredentials true
_oldAjax = jQuery.ajax
jQuery.ajax = (opts) ->
    opts.xhrFields ?= {}
    opts.xhrFields.withCredentials = true

    _oldAjax.call jQuery, opts

# Configure moment().calender() to be used as an alternative to moment().from()
relative = -> "[#{ @from() }]"
relativePlus = -> "[#{ @from() }] ([#{ @format('l h:mma') }])"

moment.lang 'en',
    calendar:
        nextWeek: relativePlus
        nextDay: relativePlus
        sameDay: relative
        lastDay: relativePlus
        lastWeek: relativePlus
        sameElse: relativePlus

$ -> app.initialize()
{'fraction_non_alphanumeric': 0.12312703583061889, 'fraction_numerical': 0.0, 'mean_word_length': 3.9389067524115755, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6796523', 'n_tokens_mistral': 461, 'n_tokens_neox': 458, 'n_words': 129}