- Amazon ECS Optimized AMI: ami-b4ae1dd7
- Instance Type: t2.small
- Name: [CONFIG_NAME]
- IAM role: fever_ecs
- User data: As text
| // Sequence of numbers | |
| val xs = Seq(1, 5, 3, 4, 6, 2) | |
| // Sort using Natural ordering as defined for Integers in Scala Library | |
| xs.sorted //1,2,3,4,5,6 | |
| // Sort 'with' a comparator function | |
| xs.sortWith(_<_) //1,2,3,4,5,6 | |
| xs.sortWith(_>_) //6,5,4,3,2,1 | |
| xs.sortWith((left,right) => left > right) //6,5,4,3,2,1 |
| var express = require("express"); | |
| var app = express(); | |
| app.get("/restricted", function(req, res, next){ | |
| // Grab the "Authorization" header. | |
| var auth = req.get("authorization"); | |
| // On the first request, the "Authorization" header won't exist, so we'll set a Response | |
| // header that prompts the browser to ask for a username and password. |
| require 'uri' | |
| namespace :mongo do | |
| desc "Dump the production database and restore to development and staging databases." | |
| task :dump_and_restore => :environment do | |
| dev = URI.parse(ENV["MONGO_URI"]) | |
| prod = URI.parse(`heroku config:get MONGO_URI --remote production`) | |
| prod_username, prod_password = prod.userinfo.split(':') |
| import android.app.Activity; | |
| import android.app.Service; | |
| import android.content.BroadcastReceiver; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import android.content.IntentFilter; | |
| import android.os.Bundle; | |
| import android.os.IBinder; | |
| import android.support.v4.content.LocalBroadcastManager; |