Skip to content

Instantly share code, notes, and snippets.

@lastab
lastab / gist:5988699cd3514bb4d9979d0a84836dc6
Created January 4, 2018 10:57
git search file_name by branch
for branch in `git for-each-ref --format="%(refname)" refs/heads`; do
echo $branch :; git ls-tree -r --name-only $branch | grep '<foo>'
done
# file type PDF
# word is in odd page and meaning is in even page
require 'rubygems'
require "pdf/reader"
reader = PDF::Reader.new("Vocabulary Flash Cards1.pdf")
word_count = reader.page_count / 2
random_word_index = rand(2..word_count) * 2 - 1
# 2.. is used because first 4 pages contains conver and table of contents
** hello world 1
[ ] Test
tmuxinator
This is a test