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 Blog | |
# ... | |
attr_writer :post_source | |
# ... | |
private | |
def post_source | |
@post_source ||= Post.public_method(:new) | |
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
### Core library for EchoSign APIs | |
### Use a wrapper file for validations & response handling | |
### Get a Developer Edition account & replace "YOUR_ACCOUNT_API_KEY" with API key of your account. | |
### With Rails, use Savon gem for SOAP based requests. | |
module EchoSignApi | |
API_URI = 'https://secure.echosign.com/services/EchoSignDocumentService15?wsdl' | |
API_KEY = YOUR_ACCOUNT_API_KEY |
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 'time' | |
Date_of_birth = '1988-8-31' | |
# Credit to : http://stackoverflow.com/questions/4136248/how-to-generate-a-human-readable-time-range-using-ruby-on-rails | |
# and modified a little bit | |
def humanize secs | |
[ | |
[60, :seconds], | |
[60, :minutes], |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>Hello World in Backbone.js</title> | |
</head> | |
<body> | |
<div id="container">Loading...</div> | |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Bootstrap Demo</title> | |
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> |
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
// ======= You can try below example using - | |
// http://trymustache.com/ ====== | |
// == Just Copy-Paste below code in "Mustache Template section == " | |
{{#content}} | |
<div style="width: 100%;"> | |
{{title}} | |
</div> |
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
# zeus gem help you run rails commands faster in Development mode | |
# It preloads your rails app so that everytime when you execute normal development commands, it takes less than a second to execute them. | |
# Do not include this gem to bundle | |
# Go to rails project directory & run below commands | |
> gem install zeus # if not installed | |
> zeus start |
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
group :development do | |
gem 'better_errors' | |
gem 'binding_of_caller' | |
gem 'meta_request' | |
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
OVERVIEW | |
__________________________ | |
AngularJS is a powerful framework. In recent years, more and more of the web has become populated with AJAX-based applications, replacing static HTML pages. This is a great development for users because it makes applications much faster and richer. But making your application more responsive has come at a huge cost: crawlers are not able to see any content that is created dynamically. As a result, the most modern applications are also the ones that are often the least searchable. | |
PROBLEMS | |
__________________________ | |
1/ The Hash Fragment (#) - AJAX URLs | |
2/ Dynamic content rendering using AngularJS variables | |
SOLUTION |
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
# First step to AWS - learn to generate SSH key for servers | |
Generate Key in Mac | |
>> ssh-keygen | |
Give path & key name | |
>> Enter file in which to save the key (/Users/username/.ssh/id_rsa): /Users/username/.ssh/test_ssh | |
Enter password (optional) | |
>> Enter passphrase (empty for no passphrase): | |
>> Enter same passphrase again: | |
"Your identification has been saved in /Users/username/.ssh/test_ssh. |
OlderNewer