Skip to content

Instantly share code, notes, and snippets.

View dmmoody's full-sized avatar
🏠
Working from home

Duane M. Moody dmmoody

🏠
Working from home
View GitHub Profile
#!/usr/bin/env ruby
HELP = <<EOS
git-wtf displays the state of your repository in a readable, easy-to-scan
format. It's useful for getting a summary of how a branch relates to a remote
server, and for wrangling many topic branches.
git-wtf can show you:
- How a branch relates to the remote repo, if it's a tracking branch.
- How a branch relates to integration branches, if it's a feature branch.
@dmmoody
dmmoody / SoftwareArcheology.py
Last active January 4, 2016 04:19
Please write a paragraph explaining what it does and how it works. Then, rewrite it so that it's beautiful and elegant and the intent is clear. Feel free to use any references or tools you would normally use.
#!/usr/local/bin/python2.7
'''
The function takes an iterable, or sequence of elements, and returns a list
of the elements that occur more than once. To achieve this, the first step
is to count the number of times each unique element occurs in the iterable
and stores that in a dictionary as a key value pair. The function then places
all key value pairs in a list of tuples if the value is not equal to one (1).
Then the function places only those unique elements that were duplicated, or
had a value greater than one (1), in a list and returns that list.