Skip to content

Instantly share code, notes, and snippets.

Avatar

Tom Sherman teasherm

View GitHub Profile
@teasherm
teasherm / s3_multipart_upload.py
Last active Oct 11, 2020
boto3 S3 Multipart Upload
View s3_multipart_upload.py
import argparse
import os
import boto3
class S3MultipartUpload(object):
# AWS throws EntityTooSmall error for parts smaller than 5 MB
PART_MINIMUM = int(5e6)
View download-contentful-assets.js
"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,
@teasherm
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) {
You can’t perform that action at this time.