Skip to content

Instantly share code, notes, and snippets.

{
"title": "Change caps_lock key (rev 4)",
"rules": [{
"description": "Change caps_lock to control if pressed with other keys, to tab if pressed alone.",
"manipulators": [{
"type": "basic",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": ["any"]
let today = new Date();
let next_year =
new Date(today.getFullYear() + 1,
today.getMonth(),
today.getDate());
let calculateNextYear = (some_date) =>
new Date(some_date.getFullYear() + 1,
some_date.getMonth(),
some_date.getDate());
let today = new Date();
let next_year = calculateNextYear(today);
let leap_day = new Date(2020, 1, 29);
let next_feb_eom = new Date(2021, 1, 28);
assert(calculateNextYear(leap_day) === next_feb_eom);
let leap_day = new Date(2020, 1, 29);
let next_feb_eom = new Date(2021, 1, 28);
assert(
calculateNextYear(leap_day) === next_feb_eom
);
s = School.find('5e82753df4e68d00330979d7')
s.mailing_address.update(country: 'PA', subdivision: '8', postal_code: '0801')