<commit_before>// This is a Javascript Slate config. Documentation is here:
// https://github.com/jigish/slate/wiki/JavaScript-Configs

// Horizontal resolutions of the monitors in use.
var DELL_27 = 2560;
var DELL_24 = 1920;
var LAPTOP = 1366;

var DELL_27_SCREEN_ID = "2560x1440";
var LAPTOP_SCREEN_ID = "1366x768";
var DEFAULT_SCREEN_ID = "0";

//
//    DEFAULT SETTINGS
//
//

// pw() and fs() return functions to resize windows to a given size.
// The returned functions are called entered into app_resize_functions
// to be later called during automatic window positioning.

// Return a function to resize an window to a given position and size.
function pw(x, y, w, h) {
    return function (win, screen_id) {
        position_window(win, x, y, w, h, screen_id);
    };
}

// Return a function to resize a window to fill the screen.
function fs() {
    return function(win, screen_id) {
        full_screen(win, screen_id);
    };
}

// Each app to resize has an entry in this dictionary, keyed by application
// name. The entry consists of a resizing function for the windows of the
// application. The entry has three properties, each containing a resizing
// function. The resizing function is run on an application's windows during
// position().
//  - 27: position on 27" monitor
//  - 24: position on 24" monitor
//  - 11: position on 11" screen (laptop)
var app_resize_functions = {};


_.each([
    'Nightly',
    'Aurora',
    'Firefox',
    'FirefoxDeveloperEdition',
    'Google Chrome',
    'Evernote'
], function(name) {
    app_resize_functions[name] = {
        "27": pw(0, 22, 1366, 1019),  // top left
        "24": pw(0, 22, 1366, 1019),
        "11": fs()
    };
});

_.each([
    'LimeChat',
    '1Password'
], function(name) {
    app_resize_functions[name] = {
        "27": pw(1367, 22, 1193, 685),  // top right
        "24": pw(727, 22, 1193, 685),
        "11": fs()
    };
});

_.each([
    'Sublime Text',
    'IntelliJ IDEA',
    'Xcode'
], function(name) {
    app_resize_functions[name] = {
        "27": pw(258, 105, 1904, 1158),  // a kind of nice centering
        "24": fs(),
        "11": fs()
    };
});

_.each([
    'IBM Notes'
], function(name) {
    app_resize_functions[name] = {
        "27": pw(258, 83, 1071, 1158),  // some odd least-ugly placement
        "24": pw(258, 83, 1071, 1158),
        "11": fs()
    };
});

_.each([
    'GitHub',
    'SourceTree'
], function(name) {
    app_resize_functions[name] = {
        "27": pw(1367, 22, 1193, 900),
        "24": fs(),
        "11": fs()
    };
});

_.each([
    'Terminal'
], function(name) {
    app_resize_functions[name] = {
        "27": pw(0, 22, 1366, 685),
        "24": pw(0, 22, 1366, 685),
        "11": fs()
    };
});

app_resize_functions["Adium"] = {
    "27": pw(2105, 755, 455, 685),
    "24": pw(1465, 515, 455, 685),
    "11": pw(1366-455, 22, 455, 685)
};

app_resize_functions["Spotify"] = {
    "27": fs(),
    "24": fs(),
    "11": fs()
};

app_resize_functions["Sametime"] = {
    "27": function (win) {
        var is_buddy_list = win.title().indexOf("IBM Sametime") !== -1;
        (is_buddy_list ? pw(1575, 0, 339, 685) : pw(1915, 0, 648, 685))(win);
    },
    "24": function (win) {
        var is_buddy_list = win.title().indexOf("IBM Sametime") !== -1;
        (is_buddy_list ? pw(0, 0, 455, 685) : pw(456, 0, 648, 685))(win);<commit_msg>Allow resize-wrapper functions to take screen_id<commit_after>// This is a Javascript Slate config. Documentation is here:
// https://github.com/jigish/slate/wiki/JavaScript-Configs

// Horizontal resolutions of the monitors in use.
var DELL_27 = 2560;
var DELL_24 = 1920;
var LAPTOP = 1366;

var DELL_27_SCREEN_ID = "2560x1440";
var LAPTOP_SCREEN_ID = "1366x768";
var DEFAULT_SCREEN_ID = "0";

//
//    DEFAULT SETTINGS
//
//

// pw() and fs() return functions to resize windows to a given size.
// The returned functions are called entered into app_resize_functions
// to be later called during automatic window positioning.

// Return a function to resize an window to a given position and size.
function pw(x, y, w, h, outer_screen_id) {
    return function (win, screen_id) {
        // Allow outer_screen_id to override screen_id
        if(typeof(outer_screen_id) !== 'undefined') {
            screen_id = outer_screen_id;
        }
        position_window(win, x, y, w, h, screen_id);
    };
}

// Return a function to resize a window to fill the screen.
function fs(outer_screen_id) {
    return function(win, screen_id) {
        // Allow outer_screen_id to override screen_id
        if(typeof(outer_screen_id) !== 'undefined') {
            screen_id = outer_screen_id;
        }
        full_screen(win, screen_id);
    };
}

// Each app to resize has an entry in this dictionary, keyed by application
// name. The entry consists of a resizing function for the windows of the
// application. The entry has three properties, each containing a resizing
// function. The resizing function is run on an application's windows during
// position().
//  - 27: position on 27" monitor
//  - 24: position on 24" monitor
//  - 11: position on 11" screen (laptop)
var app_resize_functions = {};


_.each([
    'Nightly',
    'Aurora',
    'Firefox',
    'FirefoxDeveloperEdition',
    'Google Chrome',
    'Evernote'
], function(name) {
    app_resize_functions[name] = {
        "27": pw(0, 22, 1366, 1019),  // top left
        "24": pw(0, 22, 1366, 1019),
        "11": fs()
    };
});

_.each([
    'LimeChat',
    '1Password'
], function(name) {
    app_resize_functions[name] = {
        "27": pw(1367, 22, 1193, 685),  // top right
        "24": pw(727, 22, 1193, 685),
        "11": fs()
    };
});

_.each([
    'Sublime Text',
    'IntelliJ IDEA',
    'Xcode'
], function(name) {
    app_resize_functions[name] = {
        "27": pw(258, 105, 1904, 1158),  // a kind of nice centering
        "24": fs(),
        "11": fs()
    };
});

_.each([
    'IBM Notes'
], function(name) {
    app_resize_functions[name] = {
        "27": pw(258, 83, 1071, 1158),  // some odd least-ugly placement
        "24": pw(258, 83, 1071, 1158),
        "11": fs()
    };
});

_.each([
    'GitHub',
    'SourceTree'
], function(name) {
    app_resize_functions[name] = {
        "27": pw(1367, 22, 1193, 900),
        "24": fs(),
        "11": fs()
    };
});

_.each([
    'Terminal'
], function(name) {
    app_resize_functions[name] = {
        "27": pw(0, 22, 1366, 685),
        "24": pw(0, 22, 1366, 685),
        "11": fs()
    };
});

app_resize_functions["Adium"] = {
    "27": pw(2105, 755, 455, 685),
    "24": pw(1465, 515, 455, 685),
    "11": pw(1366-455, 22, 455, 685)
};

app_resize_functions["Spotify"] = {
    "27": fs(LAPTOP_SCREEN_ID),
    "24": fs(LAPTOP_SCREEN_ID),
    "11": fs(LAPTOP_SCREEN_ID)
};

app_resize_functions["Sametime"] = {
    "27": function (win) {
        var is_buddy_list = win.title().indexOf("IBM Sametime") !== -1;
        (is_buddy_list ? pw(1575, 0, 339, 685) : pw(1915, 0, 648, 685))(win);
    },
    "24": function (win) {
        var is_buddy_list = win.title().indexOf("IBM Sametime") !== -1;
        (is_buddy_list ? pw(0, 0, 455, 685) : pw(456, 0, 648, 685))(win);
{'fraction_non_alphanumeric': 0.16140253235007654, 'fraction_numerical': 0.08404062891331571, 'mean_word_length': 2.720496894409938, 'pattern_counts': {'":': 52, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5334006', 'n_tokens_mistral': 3062, 'n_tokens_neox': 2603, 'n_words': 727}