Skip to content

Instantly share code, notes, and snippets.

View attomos's full-sized avatar
💆‍♀️

Nattaphoom Chaipreecha attomos

💆‍♀️
View GitHub Profile
@attomos
attomos / main.py
Created November 28, 2020 06:25
Why assert failure does not show in logs? Checkout before() and after() 😉
import logging
import traceback
from datetime import datetime
def setup_logging():
# logging.getLogger("requests").setLevel(logging.WARNING)
# logging.getLogger("urllib3").setLevel(logging.WARNING)
# logging.getLogger("paramiko").setLevel(logging.WARNING)
today = datetime.today().strftime("%Y.%m.%d")
@attomos
attomos / fromhex.bash
Created November 10, 2020 03:08 — forked from mhulse/fromhex.bash
Bash function to convert hex to 256 terminal color.
# fromhex A52A2A
# fromhex "#A52A2A"
# BLUE_VIOLET=$(fromhex "#8A2BE2")
# http://unix.stackexchange.com/a/269085/67282
function fromhex() {
hex=$1
if [[ $hex == "#"* ]]; then
hex=$(echo $1 | awk '{print substr($0,2)}')
fi
r=$(printf '0x%0.2s' "$hex")
@attomos
attomos / markdown-details-collapsible.md
Created August 4, 2020 08:01 — forked from pierrejoubert73/markdown-details-collapsible.md
How to add a collapsible section in markdown.

A collapsible section containing markdown

Click to expand!

Heading

  1. A numbered
  2. list
    • With some
    • Sub bullets
@attomos
attomos / pipeline_pattern.py
Created March 26, 2020 13:34 — forked from kamikat/pipeline_pattern.py
a simple demo of pipeline pattern for python
def processor1(obj):
"""Require: text; yield firstchar"""
obj['firstchar'] = obj.text[:1]
return obj
def processor2(obj):
"""Require: firstchar, text2; yield concat"""
obj['concat'] = obj.firstchar + obj.text2
return obj
@attomos
attomos / nvimCondaEnv.txt
Created October 24, 2019 16:21 — forked from a-yee/nvimCondaEnv.txt
Setting up neovim python3 environment using conda
# bash commands
# lists all of your conda env
conda env list
# Create a conda env w/ python3.5
# -n sets the name for your new env. I call it neovim here
conda create -n neovim python=3.5
# add neovim for python3 to the env
# specify version you want here, 0.1.13 up to date ver atm
@attomos
attomos / tmux.md
Created October 11, 2019 01:44 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@attomos
attomos / .block
Created July 24, 2019 06:14
Search Collapsible Tree
license: mit
@attomos
attomos / uninstal_prezto.zsh
Created January 30, 2019 04:49 — forked from csturtevant/uninstal_prezto.zsh
uninstall prezto from home directory
rm -rf ~/.zprezto ~/.zlogin ~/.zlogout ~/.zpreztorc ~/.zprofile ~/.zshenv ~/.zshrc
@attomos
attomos / react-typescript.md
Created February 19, 2018 07:13 — forked from juhaelee/react-typescript.md
React + Typescript Cheatsheet

React + Typescript Cheatsheet

Setup

If you use atom... download & install the following packages:

What are Typescript type definition files? (*.d.ts)

@attomos
attomos / tmux_italic.md
Created January 30, 2018 04:39 — forked from gyribeiro/tmux_italic.md
enable italic font on tmux