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
#!/bin/zsh | |
# ANSI color codes | |
GREEN='\033[0;32m' | |
RED='\033[0;31m' | |
NC='\033[0m' # No Color | |
for directory in */; do | |
directory="${directory%/}" | |
echo -n "Stowing $directory ... " |
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 | |
def find_toml_files() -> list[str]: | |
def find_toml_files_recursively(directory_path: str, found_toml_files: list[str]) -> None: | |
def get_directory_entries(directory_path: str) -> list[str]: | |
return list(map(lambda entry: os.path.join(directory_path, entry), |
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
#include <iostream> | |
void printArgs(const int argc, const char *argv[]) | |
{ | |
std::cout << "argc: " << argc << "\n\n" | |
<< "argv:\n"; | |
for (unsigned int i{}; i < static_cast<unsigned int>(argc); ++i) | |
std::cout << "- " << argv[i] << '\n'; | |
} |
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 Program | |
{ | |
private static void PrintArgs(string[] args) | |
{ | |
Console.WriteLine("argc: " + args.Length); | |
if (args.Length > 0) | |
{ | |
Console.WriteLine("\nargs:"); | |
Console.WriteLine("- " + string.Join("\n- ", args)); | |
} |
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
#!/bin/zsh | |
OUTPUT='#!/bin/zsh\n\n# TODO' | |
FILENAME='empty_script.sh' | |
if [ $# -ne 0 ]; then | |
if [[ "$*" == *.* ]]; then | |
FILENAME="$*" | |
else | |
FILENAME="$*.sh" |
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
root = true | |
[*] | |
indent_style = space | |
indent_size = 2 | |
end_of_line = lf | |
charset = utf-8 | |
trim_trailing_whitespace = true | |
insert_final_newline = true |
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
-- help relativenumber | |
vim.cmd [[set relativenumber]] | |
-- help restore-cursor | |
-- help last-position-jump | |
vim.cmd [[autocmd BufRead * autocmd FileType <buffer> ++once | |
\ if &ft !~# 'commit\|rebase' && line("'\"") > 1 && line("'\"") <= line("$") | exe 'normal! g`"' | endif]] |
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
#!/bin/zsh | |
python3 -m venv venv | |
source ./venv/bin/activate | |
python3 -m pip install -r requirements.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
import { TaskQueue } from './task_queue.ts' | |
const queue = new TaskQueue({ | |
rateLimiter: { | |
interval: 'second', | |
tasksPerInterval: 2, | |
}, | |
}) | |
// Example with await |
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
function padNumber(n: number): string { | |
return n.toString().padStart(2, '0') | |
} | |
function formatDate( | |
date: Date, | |
offset?: Partial<{ | |
year: number | |
month: number | |
day: number |
NewerOlder