Skip to content

Instantly share code, notes, and snippets.

View colinmcintosh's full-sized avatar
🏳️‍🌈

Colin McIntosh colinmcintosh

🏳️‍🌈
View GitHub Profile

Keybase proof

I hereby claim:

  • I am colinmcintosh on github.
  • I am colinmcintosh (https://keybase.io/colinmcintosh) on keybase.
  • I have a public key whose fingerprint is 8677 7BE8 2F3B 4345 6B86 2837 B0BD 806E 5D45 F2FF

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am colinmcintosh on github.
  • I am colinmcintosh (https://keybase.io/colinmcintosh) on keybase.
  • I have a public key whose fingerprint is 8677 7BE8 2F3B 4345 6B86 2837 B0BD 806E 5D45 F2FF

To claim this, I am signing this object:

@colinmcintosh
colinmcintosh / average_file_size.sh
Created January 5, 2016 05:51
Find average file size recursively on FreeBSD
find / -name '*' -type f -print0 | xargs -0 ls -l | awk '{ total += $5; count += 1}; END { print (total/count)/1024/1024 " GB" }'
@colinmcintosh
colinmcintosh / second_largest.py
Last active November 10, 2015 19:27
Second Largest
def second_largest(list_of_numbers):
return sorted(set(list_of_numbers))[-2]
def second_largest_two(list_of_numbers):
x = None
for i in list_of_numbers:
if x is None or i > x:
x, y = i, x
return y
@colinmcintosh
colinmcintosh / exercise_13.py
Created November 9, 2015 16:15
exercise_13.py
def max_in_list(list_of_numbers):
x = list_of_numbers.pop()
for i in list_of_numbers:
if i > x: x = i
return x