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
| 0xFA1A8B6d57B252b8307770A569023f6568DF54E3 |
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
| Ch.2 - The Grammar | |
| - Blocked comments /* */ | |
| - Line comments // | |
| - /* */ can mess up regular expressions, so it is recommended to stick to // | |
| Names | |
| - names are strings. A list of reserved words: | |
| abstract | |
| boolean break byte | |
| case catch char class const continue |
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
| Algorithm - any well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values as output. | |
| Runtime Analysis | |
| - One of the most important aspects of an algorithm is how fast it is. | |
| - Worst-case runtime - how long it would take the algorithm to run if it were given the most insidious of all possible inputs. | |
| - Average-case runtime - how long it would take the algorithm to run if it were given all possible inputs. | |
| - worst-case is often easier to reason about, and therefore is more frequently used as a benchmark. | |
| Approximate completion time for algorithms, N = 100 |
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
| -- Workflow - from http://blog.littleblimp.com/post/53942611764/direct-uploads-to-s3-with-rails-paperclip-and | |
| Our app will work as follows: | |
| User uploads their file directly to a temporary directory on S3 | |
| A form callback posts the temporary file URL to our app | |
| Our app creates a new Document object, sets some initial data from the temporary S3 file, then queues a background process to move the temporary file to the location that Paperclip expects it to be and to process thumbnails if required | |
| Show users a message if they visit a file page while its still being processed | |
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
| module Computers | |
| class Apple | |
| end | |
| end | |
| module Fruits | |
| class Apple | |
| 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
| 1. Retrieving Objects from the Database | |
| Finder methods. All return an instance of ActiveRecord::Relation: | |
| bind | |
| create_with | |
| eager_load | |
| extending | |
| from | |
| group | |
| having | |
| includes |
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
| :_delete | |
| :title | |
| session | |
| request | |
| cookies | |
| response | |
| post | |
| send_data | |
| send_file |
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
| gem 'bootstrap-sass' | |
| gem 'quiet_assets' | |
| gem 'better_errors' | |
| gem 'formtastic' | |
| gem 'formtastic-bootstrap' |
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
| Session | |
| - stores small amounts of data that will be persisted between requests. | |
| - only available in the controller and the view | |
| - Session storage mechanisms: | |
| ActionDispatch::Session::CookieStore - Stores everything on the client. | |
| ActionDispatch::Session::CacheStore - Stores the data in the Rails cache. | |
| ActionDispatch::Session::ActiveRecordStore - Stores the data in a database using Active Record. (require activerecord-session_store gem). | |
| ActionDispatch::Session::MemCacheStore - Stores the data in a memcached cluster (this is a legacy implementation; consider using CacheStore instead). | |
| - stores unique ID for each session as a cookie | |
| - CookieStore holds around 4kb of data. |
NewerOlder