Skip to content

Instantly share code, notes, and snippets.

View Constantin1489's full-sized avatar

Constantin Hong Constantin1489

View GitHub Profile
@erichschroeter
erichschroeter / queue.sh
Created November 28, 2012 13:25
Shell script implementation of a Queue.
#!/bin/bash
#
# This script encapsulates the functionality of a queue. It requires there to be
# an input file with the data in the queue being separated on different lines.
#
INPUT=queue.txt
OUTPUT=trash.txt
CMD=/usr/bin/vlc
@sknutsonsf
sknutsonsf / .screenrc
Last active November 26, 2022 05:08
Screenrc for emacs lovers
# Settings for Screen to allow better use of emacs
#
# Most important: rebind ctrl-A
## Control-^ (usually Control-Shift-6) is traditional and the only key not used by emacs
escape ^^^^
#
## do not trash BackSpace, usually DEL
bindkey -k kb
bindkey -d -k kb
#
@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

@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 -
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
@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}'
@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
@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

@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"
@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