Skip to content

Instantly share code, notes, and snippets.

require 'benchmark'
big_number = 1_000_000
a = 1.upto big_number
b = big_number.upto big_number * 2
a_array = a.to_a
b_array = b.to_a
class MultipleEnumerator
include Enumerable
@chulkilee
chulkilee / open-git-remote-web
Created October 23, 2013 22:44
Open git remote in browser (mac)
#!/bin/bash
REMOTE=$1
if [[ -z "$REMOTE" ]] ; then
REMOTE='origin'
fi
PARSED=$(git remote -v | grep '(fetch)' | grep "^$REMOTE\t" | awk -F "\t| " '{print $2}' | sed -E -e 's/\.git$//' -e 's/^.+@//')
if [[ -z "$PARSED" ]] ; then
echo "Cannot find git remote: $REMOTE"
@chulkilee
chulkilee / .gitconfig
Last active March 25, 2017 07:27
Git Configuration
[alias]
# basic shortcut
br = branch
ci = commit
co = checkout
df = diff
rb = rebase
stat = status
# full info
#!/bin/bash
# https://httpd.apache.org/docs/2.2/misc/password_encryptions.html
HTPASSWD=$1
USERNAME=$2
PASSWORD=$3
ENTRY=`cat $HTPASSWD | grep "^$USERNAME:"`
HASH=`echo $ENTRY | cut -f 2 -d :`
SALT=`echo $HASH | cut -f 3 -d $`