Skip to content

Instantly share code, notes, and snippets.

Jeffrey Melloy jmelloy

Block or report user

Report or block jmelloy

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 billing.js
import React, {Component} from 'react';
export default class ResourceBill extends Component {
constructor(props) {
super(props);
this.state = {
resource: props.resource,
billing_records: [{}]
};
View serverless.yml
# Welcome to Serverless!
#
# This file is the main config file for your service.
# It's very minimal at this point and uses default values.
# You can always add more config options for more control.
# We've included some commented out config examples here.
# Just uncomment any of them to get that config option.
#
# For full config options, check the docs:
# docs.serverless.com
View cloudtrail.json
{
"Records": [
{
"eventVersion": "1.05",
"userIdentity": {
"type": "IAMUser",
"principalId": "AIDAI5HSV5Q3AL3LD7SNA",
"arn": "arn:aws:iam::836073662699:user/svc-lookglass-prd",
"accountId": "836073662699",
"accessKeyId": "AKIAIYTEDDZFXFO2MOKA",
View cloudtrail.json
{
"Records": [
{
"eventVersion": "1.05",
"userIdentity": {
"type": "AWSService",
"invokedBy": "ec2.amazonaws.com"
},
"eventTime": "2017-09-19T23:59:46Z",
"eventSource": "sts.amazonaws.com",
View serverless.yml
# Welcome to Serverless!
#
# This file is the main config file for your service.
# It's very minimal at this point and uses default values.
# You can always add more config options for more control.
# We've included some commented out config examples here.
# Just uncomment any of them to get that config option.
#
# For full config options, check the docs:
# docs.serverless.com
View gist:8740226bc6485049580d2e6508a91720
# Welcome to Serverless!
#
# This file is the main config file for your service.
# It's very minimal at this point and uses default values.
# You can always add more config options for more control.
# We've included some commented out config examples here.
# Just uncomment any of them to get that config option.
#
# For full config options, check the docs:
# docs.serverless.com
View google.py
import datetime
import logging
import struct
import sys
import os
sys.path.append("lib")
import httplib2
from googleapiclient import http
View job_check.py
import json
import boto3
import os
import logging
from clumpy.google import service
from clumpy.google.models import BigQuery_Job
from clumpy.google.storage import delete_object
from clumpy.amazon.dynamodb import put_item
from clumpy.amazon.cloudwatch import write_metrics
View test_job_new.py
def test_handler(self):
...
with patch.dict("os.environ", {"jobs": self.queue_name}):
with patch("clumpy.google.service", service):
job_check.handler({}, FakeContext(10))
View test_job.py
def test_handler(self):
sqs = boto3.resource("sqs", "us-west-2")
job_queue = sqs.get_queue_by_name(QueueName=self.queue_name)
job_queue.send_message(
MessageBody=json.dumps(self.data)
)
bq_http = HttpMockSequence([
({'status': '200'}, self.bigquery_discovery),
You can’t perform that action at this time.