Skip to content

Instantly share code, notes, and snippets.

Ian Gilham igilham

Block or report user

Report or block igilham

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@igilham
igilham / randline-1-liner.py
Created Jan 5, 2011
read a random line from a file
View randline-1-liner.py
import random
print(random.choice([line for line in open('oblique.txt')]))
@igilham
igilham / randline.sh
Created Jan 5, 2011
Read a random line from a text file
View randline.sh
shuf -n 1 oblique.txt
# or
rl -c 1 oblique.txt
# or
sed -n $((RANDOM%$(wc -l < leader.txt)+1))p oblique.txt
You can’t perform that action at this time.