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 boto3 | |
import json | |
import csv | |
import io | |
def lambda_handler(event, context): | |
s3 = boto3.resource('s3') | |
content_object = s3.Object('src-bucket', 'src-file.json') | |
file_content = content_object.get()['Body'].read().decode('utf-8') | |
lines = file_content.splitlines() |
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
{ | |
"taskDefinitionArn": "arn:aws:ecs:us-west-2:<scc number>:task-definition/build-blog:3", | |
"revision": 3, | |
"containerDefinitions": [ | |
{ | |
"volumesFrom": [], | |
"portMappings": [], | |
"command": [], | |
"environment": [ | |
{ |
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
#include <NewPing.h> | |
const int greenPin = 2; | |
const int redPin = 4; | |
const int bluePin = 3; | |
const int trigPin = 11; | |
const int echoPin = 12; | |
enum color { | |
red, |
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
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Parameters" : { | |
"KeyName": { | |
"Type": "AWS::EC2::KeyPair::KeyName", | |
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the ECS instances" | |
}, | |
"SubnetID": { | |
"Type": "List<AWS::EC2::Subnet::Id>", | |
"Description": "List of an existing subnet IDs to use for the load balancer and auto scaling group" |
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
public static class ElmahSensitiveDataFilter | |
{ | |
public static void Apply(ExceptionFilterEventArgs e, HttpContext ctx) | |
{ | |
var sensitiveFormData = ctx.Request.Form.AllKeys.GetSensitiveFormData(); | |
if (sensitiveFormData.Count == 0) | |
{ | |
return; | |
} | |
var error = new Error(e.Exception, ctx); |
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
public override void Configure(Funq.Container container) | |
{ | |
const string statsdPrefix = "Qas.Web"; | |
//common config shared with tests | |
Config.Configure(); | |
container.Register<IStatsd>(c => new Statsd(new StatsdUDP("localhost", 8125))); | |
Plugins.Add(new MetricsFeature(container.Resolve<IStatsd>(), statsdPrefix)); |
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
public class RouteModule : NancyModule | |
{ | |
public RouteModule(IRouteCacheProvider routeCache) | |
{ | |
Get["/routes/all"] = _ => routeCache.GetCache().Select(entry => new | |
{ | |
Module = entry.Key.Name, | |
Routes = entry.Value.Select(route => route.Item2.Method + " " + route.Item2.Path) | |
}); | |
Get["/route/{moduleName}"] = _ => |
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
//in global.asax | |
void ErrorLog_Filtering(object sender, ExceptionFilterEventArgs e) | |
{ | |
var ctx = e.Context as HttpContext; | |
if(ctx == null) | |
{ | |
return; | |
} | |
ElmahSensitiveDataFilter.Apply(e, ctx); | |
} |
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
# Dockerfile for openresty | |
FROM centos:7 | |
MAINTAINER matt murphy | |
ENV http_proxy http://10.0.2.2:3128/ | |
ENV https_proxy https://10.0.2.2:3128/ | |
ENV PKG ngx_openresty-${openresty_version:-"1.7.10.1"} | |
RUN yum install -y readline-devel pcre-devel openssl-devel gcc wget perl make | |
RUN wget http://openresty.org/download/${PKG}.tar.gz \ |
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
set nocompatible | |
filetype off | |
set rtp+=%USERPROFILE%/_vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'VundleVim/Vundle.vim' | |
Plugin 'kien/ctrlp.vim' | |
call vundle#end() |
NewerOlder