Skip to content

Instantly share code, notes, and snippets.

View Constantin1489's full-sized avatar

Constantin Hong Constantin1489

View GitHub Profile
@rc2dev
rc2dev / tan
Last active July 10, 2023 20:10
Helper for adding annotations to TaskWarrior tasks (https://rafaelc.org/posts/multi-line-annotations-on-taskwarrior/).
#!/usr/bin/env bash
#
# Helper for adding annotations to TaskWarrior tasks.
# Features:
# - Add multi-line annotations to your tasks using your preferred editor.
# - Add single-line annotations as always (via cli arguments) or using the editor.
#
# Copyright (C) 2021 Rafael Cavalcanti <https://rafaelc.org/dev>
# Copyright (C) 2016 djp <djp@cutter>
#
@miguelgrinberg
miguelgrinberg / aioeventlet.py
Last active February 20, 2024 13:07
Eventlet running on top of asyncio proof-of-concept
# MIT License
#
# Copyright (c) 2023 Miguel Grinberg
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@fnky
fnky / ANSI.md
Last active July 26, 2024 10:47
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@kunalarya
kunalarya / vim-pip-macos.md
Last active October 26, 2023 13:58
Using pip to install packages for vim's python 3 on Mac
  1. Determine vim's python 3 location. From vim:
:py3 import os; print(os.__file__)

It will print something like: /usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/os.py

  1. From a shell, set a convenience variable based on the above path (note the change from lib/python3.7/os.py to bin/python3):
export VIMPY="/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/bin/python3"
@YumaInaura
YumaInaura / VIM.md
Last active July 9, 2024 05:52
Vim — What is the name of "q and colon" mode? ( A. command-line window )

Vim — What is the name of "q and colon" mode? ( A. command line window )

Or named "command window".

I mean "q and colon" ( q: ).

Not "colon and q" means quit vim ( :q ).

image

@asukakenji
asukakenji / 0-go-os-arch.md
Last active July 26, 2024 08:44
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@fsteffenhagen
fsteffenhagen / sum_filesize.sh
Last active April 15, 2024 10:04
sum human readable file sizes with numfmt and awk
# Input: list of rows with format: "<filesize> filename", e.g.
# filesizes.txt
#######################
# 1000K file1.txt
# 200M file2.txt
# 2G file3.txt
#
# Output:
cat filesizes.txt | numfmt --from=iec | awk 'BEGIN {sum=0} {sum=sum+$1} END {printf "%.0f\n", sum}'
Development Status :: 1 - Planning
Development Status :: 2 - Pre-Alpha
Development Status :: 3 - Alpha
Development Status :: 4 - Beta
Development Status :: 5 - Production/Stable
Development Status :: 6 - Mature
Development Status :: 7 - Inactive
Environment :: Console
Environment :: Console :: Curses
Environment :: Console :: Framebuffer
@ElijahLynn
ElijahLynn / pipe_to_docker_examples
Last active July 2, 2024 01:27
How to pipe to `docker exec` examples
# These examples assume you have a container currently running.
# 1 Pipe from a file
sudo docker exec --interactive CONTAINER_NAME /bin/bash < the_beginning.sh | tee the_beginning_output.txt`
#2a Pipe by piping
echo "echo This is how we pipe to docker exec" | sudo docker exec --interactive CONTAINER_NAME /bin/bash -
@eddieantonio
eddieantonio / hello.1.md
Last active January 30, 2023 12:41
man page template in Markdown

% HELLO(1) Version 1.0 | Frivolous "Hello World" Documentation

NAME

hello — prints Hello, World!

SYNOPSIS