- Queues are distributed
- Queues are limited to 120000 in-flight messages (use more small queues instead of one large queue)
- Queues may have any number of clients sending/receiving messages at once
- Queues can be created with a built in delay on message visibility
- Queues can be created just for dumping messages whose processing has failed
This file contains hidden or 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
// colour vars (or color if you're American) | |
@plain-black: #000; | |
@plain-white: #fff; | |
@funky-green: #00ff00; // original | |
.title-bar { | |
padding: 15px; | |
letter-spacing: 0.08em; | |
font-size: 1.1em; | |
} |
This file contains hidden or 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
json.success true | |
json.data do | |
json.auth_token @user.authentication_token | |
json.message "login successful" | |
end |
This file contains hidden or 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
var gulp = require('gulp'); | |
var connect = require('gulp-connect'); | |
var modRewrite = require('connect-modrewrite'); | |
var runSequence = require('run-sequence'); | |
var shell = require('gulp-shell'); | |
//proxy all requests to /api to localhost:3000 for rails api | |
gulp.task('connect', function(){ | |
connect.server({ | |
root: './app', |
Run this from an ec2 instance in the us-west-1 region.
It will create two queues and feed messages into the first queue with a timestamp, this message will then be read and the difference between the message timestamp and the current time computed and pushed into a response queue. Reading these times will give you the latency between publishing to a queue and receiving the message.
This file contains hidden or 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
require "aws-sdk" | |
require "dotenv" | |
require "reduce" | |
Dotenv.load | |
def local_dir; './_site'; end | |
def access_key; ENV['AWS_ACCESS_KEY']; end | |
def secret_key; ENV['AWS_SECRET_KEY']; end |
This file contains hidden or 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
# Using a lambda function | |
print(list(map(lambda i: "Fizz"*(i%3==0)+"Buzz"*(i%5==0) or str(i), range(1,101)))) | |
# Using a for loop | |
for i in range(1, 101): print("Fizz"*(i%3==0)+"Buzz"*(i%5==0) or str(i)) |
This file contains hidden or 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
#!/usr/bin/env python | |
############################################################################### | |
# This script downloads an object from AWS S3. If the object was encrypted, | |
# it will be decrypted on the client side using KMS envelope encryption. | |
# | |
# Envelope encryption fetches a data key from KMS and uses it to encrypt the | |
# file. The encrypted file is uploaded to an S3 bucket along with an encrypted | |
# version of the data key (it's encrypted with a KMS master key). You must | |
# have access to the KMS master key to decrypt the data key and file. To | |
# decrypt, the file is downloaded to the client, the encrypted data key is |
This file contains hidden or 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
#python3 | |
def hook(t): | |
def inner(bytes_amount): | |
t.update(bytes_amount) | |
return inner | |
BUCKET_NAME = 'your_s3_bucket_name' | |
FILE_NAME = 'your_s3_file_name' | |
s3 = boto3.resource('s3') |