Skip to content

Instantly share code, notes, and snippets.

Matt Murphy caevyn

Block or report user

Report or block caevyn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View csv.py
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()
View arduino_parking.ino
#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,
@caevyn
caevyn / ecs.json
Created Nov 17, 2015
ecs cloudformation
View ecs.json
{
"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"
@caevyn
caevyn / Dockerfile
Last active Oct 20, 2015
docker openresty
View Dockerfile
# 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 \
View basic vimrc
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()
View ApiOperationDescriptionAttribute.cs
public class ApiOperationDescriptionAttribute : Attribute
{
public string Description { get; set; }
public ApiOperationDescriptionAttribute(string description)
{
Description = description;
}
}
public class LookupOperationFilter : IOperationFilter
@caevyn
caevyn / nginx
Last active Aug 29, 2015 — forked from vdel26/nginx
View nginx
#!/bin/sh
#
# chkconfig: 2345 55 25
# Description: Nginx init.d script, put in /etc/init.d, chmod +x /etc/init.d/nginx
# For Debian, run: update-rc.d -f nginx defaults
# For CentOS, run: chkconfig --add nginx
#
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
@caevyn
caevyn / cf.json
Last active Aug 29, 2015
empty vpc
View cf.json
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "AWS CloudFormation demo thingy",
"Parameters": {
"Environment": {
"Description": "Environment",
"Type": "String",
"MinLength": "3",
"MaxLength": "4",
"Default": "DEV",
View gist:0d4e096655430a528c5e
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "ap-southeast-2",
@caevyn
caevyn / ecs.json
Last active Jun 28, 2017
ecs definition
View ecs.json
{
"taskDefinitionArn": "arn:aws:ecs:us-west-2:<scc number>:task-definition/build-blog:3",
"revision": 3,
"containerDefinitions": [
{
"volumesFrom": [],
"portMappings": [],
"command": [],
"environment": [
{
You can’t perform that action at this time.