Skip to content

Instantly share code, notes, and snippets.

View raypereda's full-sized avatar

Ray Pereda raypereda

  • Genesis Research Group
  • Long Beach, CA
View GitHub Profile
@raypereda
raypereda / latency.txt
Created January 28, 2021 17:50 — forked from jboner/latency.txt
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
@raypereda
raypereda / main.go
Created November 26, 2018 06:22 — forked from Hubro/main.go
Line counter written in Go
package main
import (
"bytes"
"fmt"
"io"
"os"
)
@raypereda
raypereda / Update remote repo
Last active May 12, 2018 06:06 — forked from mandiwise/Update remote repo
Transfer repo from Bitbucket to TFS
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
// These are steps for moving a git repo from Bitbucket to TFS
// 1. add your SSH keys to the TFS project (google for a guide)
// 2. follow the steps below
git clone git@bitbucket.org:<bitbucket_user>/<repo_name>.git
cd repo_name
git remote rename origin bitbucket
@raypereda
raypereda / The Technical Interview Cheat Sheet.md
Created February 16, 2016 00:27 — forked from deepmehtait/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

# A few examples about how to use Ruby for parsing files as we could do
# with Awk or Grep. This is based on what I learn fro this post:
# http://code.joejag.com/2009/using-ruby-as-an-awk-replacement/
# Split each line with ':' and print the first $F[0] field
awk -F: '{ print $1 }' /etc/passwd
ruby -F: -nae 'puts $F[0]' /etc/passwd
# Parse the 'ps aux' output
# It'll print the ID process for the 'jojeda' user