Skip to content

Instantly share code, notes, and snippets.

import serial
# set dev path
dev_path = ''
baudrate = 9600
ser = serial.Serial(dev_path, baudrate, timeout=0)
ser.flushInput()
ser.flushOutput()
@yzdann
yzdann / KeyMappings
Created January 26, 2019 14:32 — forked from rubyonrailsworks/KeyMappings
NerdTree
o.......Open files, directories and bookmarks....................|NERDTree-o|
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
i.......Open selected file in a split window.....................|NERDTree-i|
gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
s.......Open selected file in a new vsplit.......................|NERDTree-s|
gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|
O.......Recursively open the selected directory..................|NERDTree-O|
x.......Close the current nodes parent...........................|NERDTree-x|
@yzdann
yzdann / .vimrc
Last active June 10, 2019 12:18
" commentry Plugin
:set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" vundle
Plugin 'VundleVim/Vundle.vim'
" theme
Plugin 'liuchengxu/space-vim-dark'
" nerd tree and tagbar

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

@yzdann
yzdann / generate_data.sh
Created April 20, 2019 11:28
A simple SHA256 hashing example, written in Python using hashlib
#!/bin/bash
# Generates ten data files, each 300 MB in size and filled with random data.
[[ ! -d "data/" ]] && mkdir "data/"
for i in {1..10}; do
dd if="/dev/random" of="data/file${i}" bs=1m count=300
done
@yzdann
yzdann / .tmux.conf
Last active November 27, 2020 14:08
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'pwittchen/tmux-plugin-spotify'
#
set-option -g default-shell /bin/zsh
unbind C-b
set -g prefix C-a
# Created by newuser for 5.2
source ~/.antigen.zsh
source ~/.aliasly
# installing fzf with `apt install fzf`
# go
export PATH=$PATH:/usr/local/go/bin export GOPATH=$HOME/Dev/gokari
export PATH=$PATH:$GOPATH/bin
# virtualenv
@yzdann
yzdann / sed cheatsheet
Created May 22, 2019 09:35 — forked from ssstonebraker/sed cheatsheet
Sed Cheatsheet
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'

Be explicit, use COPY over ADD

At first glance it looks like COPY and ADD does the same thing but there is a difference. ADD is able to extract TAR files as well, which COPY can't do. So be explicit and use COPY when you mean to copy files and ensure to only use ADD when you mean to use something feature specific like the mentioned TAR extraction.

For web developers, this might include things like :

  •    MVC, MVVM, etc.
    
  •   Refactorings
    
  •   OOP principles
    
  •   Other paradigms like functional programming
    
  •   Application deployment
    
  •   Able to own features
    
  •   Beginning to lead communications with clients from time-to-time
    

For database developers, it might include:

  • Replication