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
lazy val root = (project in file(".")). | |
settings( | |
name := "helloWorld", | |
version := "0.1", | |
scalaVersion := "2.10.6" | |
) | |
libraryDependencies ++= Seq( | |
"com.github.seratch" %% "awscala" % "0.5.+", | |
"org.scalatest" % "scalatest_2.10" % "2.2.6" % "test", |
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 botocore | |
import logging | |
import requests | |
# setup simple logging for INFO | |
logging.basicConfig() | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) |
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
module Api | |
class BaseController < ApplicationController | |
protect_from_forgery with: :null_session | |
before_action :set_resource, only: [:destroy, :show, :update] | |
respond_to :json | |
private | |
# Returns the resource from the created instance variable | |
# @return [Object] |
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
## db/seeds.db | |
# | |
# Taken from real headlines in 2013 | |
News.create!(title:'Bear Steals Entire Dumpster - Twice', news:'bear story') | |
News.create!(title:'CarJacker Folied by his own Walker', news:'He couldn\'t make a fast getaway because it took him too long to load his walker into the stolen car!') | |
News.create!(title:'Giant Purple Chicken Stolen', news:'Three men were arrested in Putnam County, Florida, for stealing a 9-foot-tall purple chicken') | |
News.create!(title:'Government Agency Smashed Computers to get Rid of Viruses', news:'The destruction not stopped - sparing $3 million of equipment - because the agency had run out of money to pay for destroying the hardware.') | |
News.create!(title:'Chinese Zoo Displays Dog as Lion', news:'A private zoo in Luohe, Henan province, China, is under fire for trying to pass off a Tibetan mastiff, a particularly hairy dog, as an African lion.') |
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
# db/seeds.db | |
# rentals app | |
Rental.create!(city:'Greenville', state:'SC', price:675, landlord_id:3, email:'rooms@rents.com') | |
Rental.create!(city:'Greenville', state:'SC', price:875, landlord_id:4, email:'sc_rentals@gmail.com') | |
Rental.create!(city:'Charleston', state:'SC', price:725, landlord_id:3, email:'sc_properties@yahoo.com') | |
Rental.create!(city:'Charleston', state:'SC', price:450, landlord_id:2, email:'sc_properties@yahoo.com') | |
Rental.create!(city:'Greenville', state:'SC', price:500, landlord_id:2, email:'sc_properties@yahoo.com') |
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
#!/bin/bash | |
# Checking a custom process and send to | |
# AWS CloudWatch via a custom metric. | |
# This can then be complimented with a cloudwatch | |
# alert and SNS topic. | |
# | |
# PreRequisites: You will need to have the | |
# AWS-CLI installed on the system running this | |
# script. | |
# Also the script needs to run as a sudo uses that |