<commit_before>(function() {
    var sendDataToServer = function(sub) {
        var url = "/api/my/push_notification_subscriptions";
        var extract = function(key) {
            btoa(String.fromCharCode.apply(null, new Uint8Array(key))).replace(/\+/g, '-').replace(/\//g, '_')
        };
        var data = {
            endpoint: sub.endpoint,
            p256dh: extract(sub.getKey('p256dh')),
            auth: extract(sub.getKey('auth'))
        };

        $.post(url, data, function() {
            console.log('Saved to server!');
        });
    };

    var registerPushNotifications = function(e) {
        if ('serviceWorker' in navigator) {
            console.log('Service Worker is supported');
            navigator.serviceWorker.register('/sw.js').then(function(sreg) {
                console.log(':^)', sreg);
                navigator.serviceWorker.ready.then(function (reg) {
                    reg.pushManager.subscribe({
                        userVisibleOnly: true<commit_msg>Soooo did push registration ever work? I hate prod debugging<commit_after>(function() {
    var sendDataToServer = function(sub) {
        var url = "/api/my/push_notification_subscriptions";
        var extract = function(key) {
            return btoa(String.fromCharCode.apply(null, new Uint8Array(key))).replace(/\+/g, '-').replace(/\//g, '_')
        };
        var data = {
            endpoint: sub.endpoint,
            p256dh: extract(sub.getKey('p256dh')),
            auth: extract(sub.getKey('auth'))
        };

        $.post(url, data, function() {
            console.log('Saved to server!');
        });
    };

    var registerPushNotifications = function(e) {
        if ('serviceWorker' in navigator) {
            console.log('Service Worker is supported');
            navigator.serviceWorker.register('/sw.js').then(function(sreg) {
                console.log(':^)', sreg);
                navigator.serviceWorker.ready.then(function (reg) {
                    reg.pushManager.subscribe({
                        userVisibleOnly: true
{'fraction_non_alphanumeric': 0.1438953488372093, 'fraction_numerical': 0.006782945736434108, 'mean_word_length': 2.0323054331864903, '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': '3436762', 'n_tokens_mistral': 586, 'n_tokens_neox': 564, 'n_words': 103}