Skip to content

Instantly share code, notes, and snippets.

View joer14's full-sized avatar

Joe Rowley joer14

View GitHub Profile
@jesstelford
jesstelford / pr-compare.sh
Last active December 5, 2022 10:46
List the Pull Requests which have been merged into one branch but not another. Execute this from within a git directory that has it's `origin` remote set to github.
#!/bin/sh
if (( $# < 2 )) || (( $# > 3 ))
then
echo "$0 <are-in-this-branch> <are-not-in-this-branch> [<url-of-repo>]"
exit 1
fi
URLPREFIX=
if (( $# == 3 ))
then
URLPREFIX=$(echo "$3/pull/" | sed -e 's/[\/&]/\\&/g')
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active April 26, 2024 23:26 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 28, 2024 12:29
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jboner
jboner / latency.txt
Last active April 30, 2024 07:56
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
@v-yarotsky
v-yarotsky / .tmux.conf
Created March 22, 2012 11:57
Mac OS X tmux config
### INSTALLATION NOTES ###
# 1. Install Homebrew (https://github.com/mxcl/homebrew)
# 2. brew install zsh
# 3. Install OhMyZsh (https://github.com/robbyrussell/oh-my-zsh)
# 4. brew install reattach-to-user-namespace --wrap-pbcopy-pbpaste && brew link reattach-to-user-namespace
# 5. Install iTerm2
# 6. In iTerm2 preferences for your profile set:
# Character Encoding: Unicode (UTF-8)
# Report Terminal Type: xterm-256color
# 7. Put itunesartist and itunestrack into PATH
@andrewschoen
andrewschoen / S3 bucket sync
Created February 3, 2012 21:22
Python script to sync an S3 bucket to the local file system
# -*- coding: utf-8 -*-
import os
import StringIO
import hashlib
try:
from boto.s3.connection import S3Connection
from boto.s3.key import Key
except ImportError:
raise ImproperlyConfigured, "Could not load Boto's S3 bindings."
@febuiles
febuiles / songs.md
Last active July 1, 2022 03:45
Fetching lyrics in Unix

Fetching lyrics in the command line

Objective: Print the lyrics for the current playing song.

How: We'll create a small bash script to do the fetching for us (using curl) and then we'll display it either in the terminal or in our $EDITOR

Get the current song

First we'll need to get the name of the current song and its artist:

@justintv
justintv / .bashrc
Created August 17, 2009 00:53
Display git branch in bash prompt
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer!
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ "
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty!
# ~/code/web:beta_directory$ git checkout master
# Switched to branch "master"
# ~/code/web:master$ git checkout beta_directory
# Switched to branch "beta_directory"