Skip to content

Instantly share code, notes, and snippets.

View teasherm's full-sized avatar

Tom Sherman teasherm

View GitHub Profile
@teasherm
teasherm / s3_multipart_upload.py
Last active February 4, 2024 04:44
boto3 S3 Multipart Upload
import argparse
import os
import boto3
class S3MultipartUpload(object):
# AWS throws EntityTooSmall error for parts smaller than 5 MB
PART_MINIMUM = int(5e6)
@teasherm
teasherm / rod_cutting.c
Created March 3, 2017 23:32
Rod cutting algorithms from 15.1 of Intro to Algorithms (Dynamic Programming), implemented in C
#include <stdio.h>
#include <stdlib.h>
// doesn't work for pointer (e.g. if array passed in as parameter)
#define ARRAYSIZE(arr) (int) (sizeof(arr) / sizeof(arr[0]))
// helper
int max_int(int x, int y) {
"use strict";
const ProgressBar = require(`progress`);
const {
createRemoteFileNode
} = require(`gatsby-source-filesystem`);
const bar = new ProgressBar(`Downloading Contentful Assets [:bar] :current/:total :elapsed secs :percent`, {
total: 0,