Skip to content

Instantly share code, notes, and snippets.

View mike239x's full-sized avatar
:octocat:
the last gitbender

Mike Lezhnin mike239x

:octocat:
the last gitbender
View GitHub Profile
@mike239x
mike239x / bash-builtins.txt
Last active March 17, 2021 14:14
A list of builtin commands for bash (list taken from man-page for bash 4.4)
// here is similar list for fish-shell - https://fishshell.com/docs/2.2/commands.html
source
alias
bg
bind
break
builtin
caller
cd
command
@mike239x
mike239x / 90-caps2ctrl.conf
Last active September 3, 2019 18:34
xkb config file for mapping caps to ctrl
# This is a config file that maps caps-lock key to yet another ctrl key.
# It works pretty much on any Linux system with XKb, the X Keyboard extention,
# so anything that has Xorg would probably work.
# The file goes to /etc/X11/xorg.conf.d/ folder.
Section "InputClass"
Identifier "keyboard defaults"
MatchIsKeyboard "on"
Option "XKbOptions" "caps:ctrl_modifier"
@mike239x
mike239x / notes.md
Last active August 30, 2019 09:39
Thoughts on colors in the terminal

Here is an idea: how about we drastically modify the way the coloring is done in terminals and in text in general?

Reasoning:

  1. Right now it is really hard to make the text you write colorful.
  2. The control flow for the terminal is quite convoluted - most programs stop coloring output if the pipe doesn't lead to tty, so your bash scripts end up looking like a mess.
  3. External highlighters (or absence thereof) can change the coloring (of your code for example), which may be not desired.

What do we have?

  1. ANSI codes. Works only in terminals with color support (which is like 100% of them), works even better with terminals with true color support (which is a bit less than 100% of them). By the way, this gist and many of its forks contain a list of terminals supporting true color.
@mike239x
mike239x / lib.rs
Last active August 28, 2019 15:51
Trying to create graphs in Rust
// this code is released under creative common license (CC0),
// meaning you are free to use/modify/distribute it in any way you see fit
// and I am not responsible for anything that happens
trait Graph {
type Node;
type Edge;
fn add_node(self: &mut Self, node: Self::Node);
fn add_edge(self: &mut Self, edge: Self::Edge);
fn incident_edges(self: &Self, node: Self::Node) -> Vec<Self::Edge>;
@mike239x
mike239x / python_venv.md
Created May 5, 2019 08:45
how to make python virtual environments - guide for idiots like me
$ python3 -m venv py3