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, |
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) { |
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) |