Skip to content

Instantly share code, notes, and snippets.

@wtask
wtask / functional-options.go
Last active June 17, 2022 22:48
Golang functional options pattern by Dave Cheney with little improvments due to practice.
// optionsptrn - inspired by https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis
package optionsptrn
import (
"errors"
"time"
// ...
)
// service - to implement SomeInterface.
@mattbillenstein
mattbillenstein / s3put
Created December 13, 2011 10:02
boto parallel s3 upload script
#!/usr/bin/env python
import gevent.monkey
gevent.monkey.patch_all()
import boto
import config
import gevent
import gevent.pool
import os
@fabiant7t
fabiant7t / s3_multipart_upload.py
Created April 17, 2011 14:54
Parallel S3 multipart upload with retries
import logging
import math
import mimetypes
from multiprocessing import Pool
import os
from boto.s3.connection import S3Connection
from filechunkio import FileChunkIO