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
/Users/toamitkumar/.rvm/gems/ruby-1.8.7-p334@ggih/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:470:in `assert_no_example_groups_defined': RSpec's mock_framework configuration option must be configured before any example groups are defined, but you have already defined a group. (RSpec::Core::Configuration::MustBeConfiguredBeforeExampleGroupsError) | |
from /Users/toamitkumar/.rvm/gems/ruby-1.8.7-p334@ggih/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:168:in `mock_framework=' | |
from /Users/toamitkumar/.rvm/gems/ruby-1.8.7-p334@ggih/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:142:in `mock_with' | |
from /Users/toamitkumar/development/rails_apps/deep-fog-4594/spec/spec_helper.rb:19 | |
from /Users/toamitkumar/.rvm/gems/ruby-1.8.7-p334@ggih/gems/rspec-core-2.7.1/lib/rspec/core.rb:71:in `configure' | |
from /Users/toamitkumar/development/rails_apps/deep-fog-4594/spec/spec_helper.rb:11 | |
from /Users/toamitkumar/.rvm/gems/ruby-1.8.7-p334@ggih/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:23 |
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
$ sudo cd /some/path | |
sudo: cd: command not found |
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
Executing curl http://localhost/nginx_status | |
** [out :: root@172.16.179.136] [Wed, 11 Jan 2012 00:40:33 -0500] DEBUG: ---- Begin output of curl http://localhost/nginx_status ---- | |
** [out :: root@172.16.179.136] [Wed, 11 Jan 2012 00:40:33 -0500] DEBUG: STDOUT: <html> | |
** [out :: root@172.16.179.136] <head><title>404 Not Found</title></head> | |
** [out :: root@172.16.179.136] <body bgcolor="white"> | |
** [out :: root@172.16.179.136] <center><h1>404 Not Found</h1></center> | |
** [out :: root@172.16.179.136] <hr><center>nginx/1.0.10</center> | |
** [out :: root@172.16.179.136] </body> | |
** [out :: root@172.16.179.136] </html> |
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
Steps: | |
If you are using RVM, then follow the steps below: | |
1. Clear your gemset | |
$ rvm gemset empty | |
2. Update to the latest version of rubygems | |
$ gem update --system |
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
<iframe height='0px' id='exportIFrame' name='exportIFrame' style='visibility:hidden' width='0px'></iframe> | |
<form action='url to form submit' id='exportForm' method='post' name='exportForm' target='exportIFrame'> | |
<input id='attr1' name='attr1' type='hidden'> | |
<input id='attr2' name='attr2' type='hidden'> | |
<textarea id='json' name='json' style='visibility:hidden'></textarea> | |
</form> | |
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
/* https://github.com/carhartl/jquery-cookie */ | |
$("a.linkDownload").click(function(event) { | |
.... other action on click of link | |
$(this).bindDownloadEvents(event); // bind the form submit event | |
}); | |
$.fn.bindDownloadEvents = function(event) { | |
event.preventDefault(); | |
showDownloadIndicator(this); |
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
/* | |
* The code on the server side has content disposition as attachment | |
* It adds a cookie for the filedownload status | |
* remember to flush the response | |
*/ | |
response.setHeader("Content-Disposition", "attachment; filename="+downloadFileName); | |
Cookie cookie = new Cookie("fileDownloadStatus", "complete"); | |
cookie.setPath("/"); |
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 SomeRandomClass | |
def caller | |
string = "" | |
string = first(string) | |
string = second(string) | |
third(string) | |
end | |
def first(string) | |
# update the string |
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
Day 1: | |
GetTweets | |
1. | |
var n = $('<li />').appendTo(tweetList).text(feed[i].text); | |
# This will add "li" to the DOM inside loop. Not good for performance. | |
# Its better to build a string inside a loop and add the whole string to the DOM outside of loop. | |
2. |
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
Day 1 | |
Form.html | |
Excellent. Inline CSS and JS is bad practice. Always create files and include them. | |
Day 2: | |
Tweets.html | |
1. |