Skip to content

Instantly share code, notes, and snippets.

View hoop33's full-sized avatar
🏈

Rob Warner hoop33

🏈
View GitHub Profile

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@jboner
jboner / latency.txt
Last active December 26, 2024 09:26
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
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active December 25, 2024 19:39
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1
@denji
denji / http-benchmark.md
Last active December 14, 2024 20:49
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
@arsham
arsham / lint_go_code.sh
Last active April 19, 2020 16:20
Go ultimate linters. #golang #linting
# Installation:
# go get -u github.com/thraxil/cyclo
# go get -u github.com/client9/misspell
# go get -u honnef.co/go/tools/cmd/staticcheck
# go get -u honnef.co/go/tools/cmd/gosimple
# go get -u honnef.co/go/tools/cmd/unused
# go get -u github.com/jgautheron/goconst/cmd/goconst
# go get -u github.com/jgautheron/usedexports
# go get -u mvdan.cc/interfacer
# go get -u github.com/tsenart/deadcode
@adrianhall
adrianhall / AppSyncAPI.yaml
Last active September 25, 2024 01:43
A CloudFormation template for DynamoDB + Cognito User Pool + AppSync API for the Notes tutorial
---
Description: AWS AppSync Notes API
Parameters:
APIName:
Type: String
Description: Name of the API - used to generate unique names for resources
MinLength: 3
MaxLength: 20
AllowedPattern: '^[a-zA-Z][a-zA-Z0-9_]*$'
@ole
ole / UIAlertController+TextField.swift
Last active September 13, 2022 14:20
A UIAlertController with a text field and the ability to perform validation on the text the user has entered while the alert is on screen. The OK button is only enabled when the entered text passes validation. More info: https://oleb.net/2018/uialertcontroller-textfield/
import UIKit
/// A validation rule for text input.
public enum TextValidationRule {
/// Any input is valid, including an empty string.
case noRestriction
/// The input must not be empty.
case nonEmpty
/// The enitre input must match a regular expression. A matching substring is not enough.
case regularExpression(NSRegularExpression)