As configured in my dotfiles.
start new:
tmux
start new with session name:
As configured in my dotfiles.
start new:
tmux
start new with session name:
| #Model | |
| @user.should have(1).error_on(:username) # Checks whether there is an error in username | |
| @user.errors[:username].should include("can't be blank") # check for the error message | |
| #Rendering | |
| response.should render_template(:index) | |
| #Redirecting | |
| response.should redirect_to(movies_path) |
| # An example of how to use AWS SNS with Python's boto | |
| # By Stuart Myles @smyles | |
| # http://aws.amazon.com/sns/ | |
| # https://github.com/boto/boto | |
| # | |
| # Inspired by parts of the Ruby SWF SNS tutorial http://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-sns-tutorial-implementing-activities-poller.html | |
| # And the Python SNS code in http://blog.coredumped.org/2010/04/amazon-announces-simple-notification.html and http://awsadvent.tumblr.com/post/37531769345/simple-notification-service-sns | |
| import boto.sns as sns | |
| import json |
| CREATE TABLE books ( | |
| isbn char(14) NOT NULL, | |
| title varchar(255), | |
| author varchar(255), | |
| price decimal(5,2) | |
| ); | |
| INSERT INTO books (isbn, title, author, price) VALUES | |
| ('978-1503261969', 'Emma', 'Jayne Austen', 9.44), | |
| ('978-1514274873', 'Journal of a Soldier', NULL, 5.49), |
| . | |
| ├── books | |
| │ ├── handlers.go | |
| │ └── models.go | |
| ├── config | |
| │ └── db.go | |
| └── main.go |
I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.
So it might be really unintuitive at first but lambda functions have three states.
| import time | |
| import redis | |
| def get_redis_connection(): | |
| return redis.connect() | |
| class TaskDebouncer(object): | |
| """ A simple Celery task debouncer. |