Skip to content

Instantly share code, notes, and snippets.

Avatar

Aaron Hoffman aaronhoffman

View GitHub Profile
@markusklems
markusklems / lambda-dynamo
Last active Jul 18, 2020
Short aws lambda sample program that puts an item into dynamodb
View lambda-dynamo
// 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) {
@7Pass
7Pass / MoqExtensions.cs
Last active Sep 5, 2019
Extension methods to quickly ignore arguments without repeating It.IsAny<>()
View MoqExtensions.cs
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 Nov 13, 2008
Ruby array for state codes
View state_codes.rb
STATE_CODES = [
['AL', 'ALABAMA'],
['AK', 'ALASKA'],
['AZ', 'ARIZONA'],
['AR', 'ARKANSAS'],
['CA', 'CALIFORNIA'],
['CO', 'COLORADO'],
['CT', 'CONNECTICUT'],
['DE', 'DELAWARE'],
['DC', 'DISTRICT OF COLUMBIA'],
You can’t perform that action at this time.