-
Meteor apps, by default, have an insecure package. It's best to keep this in at the start to make development easier but ulltimately this will need to be removed and secure operation need to be added manually.
-
Same with a package called autopublish. This publishs all data up to the clients automatically. Ultimately this needs to be removed and publish/subscribe needs to be managed manually.
-
Meteor Methods can be used to make things more secure. Meteor methods use RPC calls to methods defined on the server. The nice thing is, you also define them on the client. So, when you call a meteor method it executes on the client and the server - the client returns instantly then, once the server returns, if there's a difference, it will patch up the client. (This is latency compensation).
-
As mentioned before, some things are defined on the client, some are defined on the server, and some are defined on the server and the client. It's a bit hard to get you're head around this at the st
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
map.connect 'archives/:year/:month', | |
:controller => 'posts', | |
:action => 'find_by_date', | |
:year => /\d{4}/, | |
:month => /(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/ |
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
def to_param | |
"#{id}-#{title.gsub(/[^a-z0-9]+/i, '-')}" | |
end |
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
class Report | |
def create_report | |
# Left blank, sub-classes will implement this | |
end | |
end | |
class XmlReport < Report | |
def create_report | |
puts "I am an Xml Report" | |
end |
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
class ReportGenerator | |
def print_report(report_type) | |
report_type.create_report | |
end | |
end |
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
user = User.find(1) | |
user_orders = user.orders |
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
require 'md5' | |
module CommentsHelper | |
def gravatar_url_for(email = null, size = 80) | |
hash = MD5::md5(email.downcase) | |
image_src = "http://www.gravatar.com/avatar/#{hash}?s=#{size}" | |
end | |
end |
OlderNewer