Skip to content

Instantly share code, notes, and snippets.

View Frodox's full-sized avatar
🎯
Focusing

Vitaly Rybnikov Frodox

🎯
Focusing
View GitHub Profile

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@chetmancini
chetmancini / countLinesOfCode.py
Last active October 3, 2015 14:47
Count the lines of code in Python dir.
def countLinesOfCode(path):
"""Procedure to count total lines of code in each file
"""
total = 0
listing = os.listdir(path)
for fname in listing:
if fname[-2:] == "py":
with open(fname) as f:
for i, l in enumerate(f):
if len(l) > 80:
@jboner
jboner / latency.txt
Last active July 4, 2024 04:27
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 3, 2024 12:57
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
# -*- coding: utf-8 -*-
import sys
import os
import fnmatch
def Walk(root='.', recurse=True, pattern='*'):
"""
Generator for walking a directory tree.
Starts at specified root folder, returning files
that match our pattern. Optionally will also
@dgolds
dgolds / dgSniffCode.sh
Last active October 11, 2015 18:37
Bash Script to do quick counts of common source code types under the current or specified directory
#!/bin/bash
# Bash Script to do quick counts of common source code types under the current or specified directory
# https://gist.github.com/3901863
# To quickly grab it, just type
# wget https://gist.github.com/raw/3901863/dgSniffCode.sh && chmod +x dgSniffCode.sh
# Features to add:
# multiple params ...A hack until I support * arguments: ls | xargs -L 1 ~/dgSniffCode
@fyears
fyears / soinput.py
Created November 28, 2012 14:46
python stdin example
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
usage:
cat about.txt | python soinput.py
'''
import sys
@sturadnidge
sturadnidge / tmux-1.8-on-CentOS-6.x.txt
Last active May 10, 2021 18:31
Install tmux 1.8 on CentOS 6.x minimal (64bit)
# download latest libevent2 and tmux sources, and extract them somewhere
# (thx bluejedi for tip on latest tmux URL)
#
# at the time of writing:
# https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
# http://sourceforge.net/projects/tmux/files/latest/download?source=files
#
# install deps
yum install gcc kernel-devel make ncurses-devel