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 typing as t | |
def ref(obj): | |
class Ref: | |
pass | |
slf = Ref() | |
slf.__obj = obj | |
build_methods(slf) |
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
#!/usr/bin/env zx | |
await cd('BACKUP FOLDER') | |
let files = await $`ls` | |
let min = 0 | |
files.stdout.split("\n").forEach(file => { | |
let fileNumber = Number.parseInt(file.split(".")[0], 10) | |
if (fileNumber > min) { | |
min = fileNumber |
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
# example: | |
range_of_ints = range(0, 500_000_000_000_000) | |
squared_ints = LazyList(range_of_ints, lambda v: v**2) | |
print(len(squared_ints) == len(range_of_ints)) # -> True | |
print(squared_ints) # -> LazyList([0, 1, 4, 9, 16, ..., 249999999999999000000000000001]) | |
print(squared_ints[55:100]) # -> LazyList([3025, 3136, 3249, 3364, 3481, ..., 9801]) | |
print(squared_ints[500]) # -> 250000 |