Skip to content

Instantly share code, notes, and snippets.

View peterarnott's full-sized avatar

Peter peterarnott

View GitHub Profile
@peterarnott
peterarnott / settings.yml
Created April 16, 2013 10:51
The settings file for antidrops
config:
version: 0.6
creative-only: true
deny-drops: true
bypass:
use: true
permission: antidrops.bypass
block:
creative:
chest-use: true
@peterarnott
peterarnott / worlds.yml
Created April 16, 2013 10:52
The worlds file for antidrops
config:
version: 0.2
worlds:
- ignoredworld
- alsoignored
@peterarnott
peterarnott / bookcount.py
Last active August 29, 2015 13:59
Count the words in a book!
import string
from collections import defaultdict
frequencies = defaultdict(int)
for line in open("book.txt"):
for word in line.lower().translate(None, string.punctuation).split():
frequencies[word] += 1
sortedlist = sorted(frequencies.items(), key=lambda x: (-x[1],x[0]), reverse=False)
with open('results.txt', 'w') as f:
for item in sortedlist:
formatted = "\"%s\": %d\n" % (item[0], int(item[1]))