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
| #!/bin/bash | |
| sort_by="files" | |
| target_dir="." | |
| while [[ $# -gt 0 ]]; do | |
| case $1 in | |
| -l|--lines) | |
| sort_by="lines" | |
| shift |
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
| from collections import defaultdict | |
| from time import perf_counter | |
| import trio | |
| from attr import attrs, attr | |
| @attrs(slots=True) | |
| class TimeInfo: | |
| deschedule_start = attr(type=float, default=0) |
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 contextlib | |
| from time import perf_counter | |
| from typing import Generator | |
| @contextlib.contextmanager | |
| def timer(subject: str = "time") -> Generator[None, None, None]: | |
| start = perf_counter() | |
| yield | |
| elapsed = perf_counter() - start |
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
| "Reflect on 5-7 different possible sources of the problem, distill those down to 1-2 most likely sources, and then add logs to validate your assumptions before we move onto implementing the actual code fix" |
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 python3 | |
| # generated with claude 3.7 Sonnet. This needs some tweaking. obviously. | |
| import os | |
| import re | |
| import yaml | |
| import glob | |
| from pathlib import Path | |
| from typing import dict, list, set, tuple |
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
| #!/bin/bash | |
| if [ $# -ne 1 ]; then | |
| echo "Usage: $0 <max_suffix_number>" | |
| exit 1 | |
| fi | |
| MAX_SUFFIX_NUMBER=$1 | |
| BASE_URL="https://huggingface.co/datasets/mteb/raw_arxiv/resolve/main/train_" |
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 os | |
| import gzip | |
| import json | |
| from pymongo import MongoClient | |
| mongo_uri = "mongodb://nebula.local:27017" | |
| client = MongoClient(mongo_uri) | |
| db = client['analytics'] | |
| collection = db['gh_archive'] |
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
| sudo apt remove gnome-2048 \ | |
| firefox | |
| gnome-todo | |
| thunderbird | |
| gnome-tetravex | |
| gnome-taquin | |
| swell-foop | |
| gnome-sudoku | |
| gnome-robots | |
| gnome-mines |
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
| // ConsoleHandler formats slog.Logger output in console format, a bit similar with Uber's zap ConsoleEncoder | |
| // The log format is designed to be human-readable. | |
| // | |
| // Performance can definitely be improved, however it's not in my priority as | |
| // this should only be used in development environment. | |
| // | |
| // e.g. log output: | |
| // 2022-11-24T11:40:20+08:00 DEBUG ./main.go:162 Debug message {"hello":"world","!BADKEY":"bad kv"} | |
| // 2022-11-24T11:40:20+08:00 INFO ./main.go:167 Info message {"with_key_1":"with_value_1","group_1":{"with_key_2":"with_value_2","hello":"world"}} | |
| // 2022-11-24T11:40:20+08:00 WARN ./main.go:168 Warn message {"with_key_1":"with_value_1","group_1":{"with_key_2":"with_value_2","hello":"world"}} |
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
| sudo apt install libspa-0.2-bluetooth | |
| systemctl --user restart wireplumber |
NewerOlder