This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let s:second = 1 | |
let s:minute = 60 * s:second | |
let s:hour = 60 * s:minute | |
let s:day = 24 * s:hour | |
let s:week = 7 * s:day | |
let s:month = 30 * s:day | |
let s:year = 365 * s:day | |
function! s:get_undo_time(undo_dict) abort | |
let l:idx = a:undo_dict.seq_cur |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import operator | |
from functools import reduce | |
from itertools import combinations | |
from typing import Union | |
Number = Union[int, float] | |
def all_close(*values: Number): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- I have discovered a way to convert _any_ lua iterator into an | |
-- object which is lazily evaluated and which can be given behaviors | |
-- somewhat similar to the Iterator trait in Rust. Further, these | |
-- objects use metatables to allow for chained calls instead of the | |
-- Python-like ugly right-to-left series of calls (e.g. | |
-- `reduce(map(filter(range(1, 4), func), func), func)`) | |
-- | |
-- This seems fairly elegent and obvious to me, so I am surprised I have not | |
-- seen any prior work in this area. I would love to be proven wrong, though! | |
-- |