Skip to content

Instantly share code, notes, and snippets.


Tom Sherman teasherm

View GitHub Profile
View download-contentful-assets.js
"use strict";
const ProgressBar = require(`progress`);
const {
} = require(`gatsby-source-filesystem`);
const bar = new ProgressBar(`Downloading Contentful Assets [:bar] :current/:total :elapsed secs :percent`, {
total: 0,
teasherm / rod_cutting.c
Created Mar 3, 2017
Rod cutting algorithms from 15.1 of Intro to Algorithms (Dynamic Programming), implemented in C
View rod_cutting.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) {
teasherm /
Last active Jul 26, 2021
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)