- 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
| 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', |
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
| // 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; | |
| } |
http://guides.rubyonrails.org/migrations.html
- add_column
- add_index
- change_column
- change_table
- create_table
- drop_table
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>comment</key> | |
| <string> | |
| TODO: unresolved issues | |
| text: |
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
| ##Userable | |
| module Userable | |
| def self.included(base) | |
| base.has_one :user, :as => :userable, :dependent => :destroy, :autosave => true | |
| base.validate :user_must_be_valid | |
| base.alias_method_chain :user, :autobuild | |
| base.extend ClassMethods | |
| base.define_user_accessors | |
| 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
| # db/migrate/20120625030355_add_deleted_at_to_user.rb | |
| class AddDeletedAtToUser < ActiveRecord::Migration | |
| def change | |
| add_column :users, :deleted_at, :time | |
| end | |
| 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
| class UrlValidator < ActiveModel::EachValidator | |
| def validate_each(record, attribute, value) | |
| valid = begin | |
| URI.parse(value).kind_of?(URI::HTTP) | |
| rescue URI::InvalidURIError | |
| false | |
| end | |
| unless valid | |
| record.errors[attribute] << (options[:message] || "is an invalid URL") |
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
| #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) |