Skip to content

Instantly share code, notes, and snippets.

View aaronhoffman's full-sized avatar

Aaron Hoffman aaronhoffman

View GitHub Profile
@MawKKe
MawKKe / split_ffmpeg.py
Last active August 7, 2021 21:50
MOVED TO: https://github.com/MawKKe/audiobook-split-ffmpeg | Split audio file with ffmpeg based on chapter metadata
#!/usr/bin/env python3
import sys
import os
import re
import subprocess as sub
import argparse
import tempfile
import json
from concurrent.futures import ThreadPoolExecutor, as_completed
@markusklems
markusklems / lambda-dynamo
Last active September 24, 2021 03:48
Short aws lambda sample program that puts an item into dynamodb
// create an IAM Lambda role with access to dynamodb
// Launch Lambda in the same region as your dynamodb region
// (here: us-east-1)
// dynamodb table with hash key = user and range key = datetime
console.log('Loading event');
var AWS = require('aws-sdk');
var dynamodb = new AWS.DynamoDB({apiVersion: '2012-08-10'});
exports.handler = function(event, context) {
@ngocvantran
ngocvantran / MoqExtensions.cs
Last active November 13, 2021 17:46
Extension methods to quickly ignore arguments without repeating It.IsAny<>()
using System;
using System.Linq.Expressions;
using Moq.Language.Flow;
namespace Moq
{
public static class MoqExtensions
{
public static ISetup<T, TResult> SetupIgnoreArgs<T, TResult>(this Mock<T> mock,
Expression<Func<T, TResult>> expression)
@wesrog
wesrog / state_codes.rb
Created November 13, 2008 21:52
Ruby array for state codes
STATE_CODES = [
['AL', 'ALABAMA'],
['AK', 'ALASKA'],
['AZ', 'ARIZONA'],
['AR', 'ARKANSAS'],
['CA', 'CALIFORNIA'],
['CO', 'COLORADO'],
['CT', 'CONNECTICUT'],
['DE', 'DELAWARE'],
['DC', 'DISTRICT OF COLUMBIA'],