- What is a class?
- What is an object?
- What is a module? Can you tell me the difference between classes and modules?
- Can you tell me the three levels of method access control for classes and modules? What do they imply about the method?
- There are three ways to invoke a method in ruby. Can you give me at least two?
- Explain this ruby idiom: a ||= b
This file contains 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
Ext.define('Ext.rails.ForgeryProtection', { | |
csrfParams: function() { | |
var params = {}; | |
var metaCsrfParam = Ext.select('meta[name=csrf-param]').item(0); | |
var metaCsrfToken = Ext.select('meta[name=csrf-token]').item(0); | |
if (metaCsrfParam != undefined && metaCsrfToken != undefined) { | |
var name = metaCsrfParam.getAttribute('content'); | |
var value = metaCsrfToken.getAttribute('content'); | |
if (name != undefined && value != undefined) { | |
params[name] = value; |
This file contains 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
Interval Queries (Basically to find Age range) | |
User.where(%q{created_at - birthdate < interval '13 years'}) |
This file contains 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
# YARD CHEATSHEET http://yardoc.org | |
cribbed from http://pastebin.com/xgzeAmBn | |
Templates to remind you of the options and formatting for the different types of objects you might | |
want to document using YARD. | |
## Modules | |
# Namespace for classes and modules that handle serving documentation over HTTP |
This file contains 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
### Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 | |
SSH into Root | |
$ ssh root@123.123.123.123 | |
Change Root Password | |
$ passwd |