Skip to content

Instantly share code, notes, and snippets.

@spacebat
spacebat / with-container-map.lisp
Created January 21, 2018 23:08
Generic container iteration
(defgeneric call-with-container-map (container func)
(:documentation "Iterate over the contents of CONTAINER, calling
FUNC with the current element of CONTAINER, followed by the index or
key that corresponds to it."))
(defmethod call-with-container-map ((container array) func)
(loop for index from 0
for value across container
do (funcall func value index)))
@zmjones
zmjones / parses3logs.py
Created February 7, 2014 13:53
parse and clean log files from AWS S3
import csv
import os
import re
import dateutil
import pandas as pd
from urlparse import urlparse
log_path = ''
# parsing code: http://ferrouswheel.me/2010/01/python_tparse-fields-in-s3-logs/
log_entries = []