This file contains 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
read_input_string(s) = parse.(Int64, filter(!isempty, split.(split(s, "\n\n")))) | |
@info "1a" maximum(sum, read_input_string(read("input.txt"))) | |
@info "1b" (sum ∘ x->last(x, 3))(sort(sum.(read_input_string(read("input.txt"))))) |
This file contains 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
try | |
using Revise | |
catch | |
@info "Revise error!" | |
end | |
try | |
using OhMyREPL | |
colorscheme!("JuliaDefault") | |
enable_autocomplete_brackets(false) |
This file contains 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
def isochrone(s): | |
return (lambda x,y : x == y)(* map(lambda f: len(f([x for x in s.lower() if s.isalpha()])), [set, lambda x: x])) |
This file contains 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
class Magic: | |
def __init__(self): | |
pass | |
magic = Magic() | |
def setmagic(f): | |
magic.__dict__[f.func_name] = f |
This file contains 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 bash | |
# python3 -m pip install shis | |
kill="" | |
reload="" | |
clean="" | |
print_help() { |
This file contains 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
PaperWM = hs.loadSpoon("PaperWM") | |
SpoonInstall = hs.loadSpoon("SpoonInstall") | |
local function make_mod(mod) | |
local function ret(s) | |
return {mod, s} | |
end | |
return ret | |
end |
This file contains 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
[style] | |
# Align closing bracket with visual indentation. | |
align_closing_bracket_with_visual_indent=False | |
# Allow dictionary keys to exist on multiple lines. For example: | |
# | |
# x = { | |
# ('this is the first element of a tuple', | |
# 'this is the second element of a tuple'): | |
# value, |
This file contains 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 python3 | |
import os | |
import sys | |
from collections import defaultdict, deque | |
from typing import List, Optional | |
def read_file(path: str) -> str: | |
if os.path.isfile(path): | |
with open(path, 'r') as f: |
This file contains 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 python3 | |
import inspect | |
import re | |
import sys | |
from collections import deque | |
from typing import Any, List, Optional | |
class Doc(object): |
This file contains 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
from clickupython import client | |
import datetime | |
import itertools as it | |
import logging | |
from rich.logging import RichHandler | |
FORMAT = "%(message)s" | |
logging.basicConfig( | |
level="INFO", format=FORMAT, datefmt="[%X]", handlers=[RichHandler()] | |
) |
NewerOlder