This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import sys | |
from collections import defaultdict | |
def print_max_field_lengths(fname): | |
""" | |
Prints the largest field lengths encountered in the csv | |
file in fname | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const glob = require('glob'); | |
const sharp = require('sharp'); | |
glob('./*.png', {}, async (e, filenames) => { | |
filenames.forEach(filename => { | |
sharp(filename) | |
.toFile(`${filename.replace(/\.png$/, '')}.jpeg`); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Signed URL generation demo | |
# Author: Fil Zembowicz <fil@formsort.com> | |
usage = "AWS_REGION=... AWS_BUCKET=... AWS_UPLOAD_FOLDER=... flask run" | |
import boto3 | |
import os | |
import uuid | |
from flask import Flask, request, abort, jsonify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Given filenames, MD5 hashes them and puts the hash in the filename | |
""" | |
import glob | |
import hashlib | |
import os | |
import random | |
import sys |