Skip to content

Instantly share code, notes, and snippets.

View toamitkumar's full-sized avatar
🏠
Working from home

Amit Kumar toamitkumar

🏠
Working from home
View GitHub Profile
/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
$ sudo cd /some/path
sudo: cd: command not found
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>
@toamitkumar
toamitkumar / gist:1648360
Created January 20, 2012 16:53
Invalid gemspec in” and “Illformed requirement”
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
<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>
/* 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);
/*
* 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("/");
class SomeRandomClass
def caller
string = ""
string = first(string)
string = second(string)
third(string)
end
def first(string)
# update the string
@toamitkumar
toamitkumar / feedback.js
Created March 30, 2012 01:37
Deolina D
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.
@toamitkumar
toamitkumar / feedback.js
Created March 30, 2012 01:57
ashutoshdikshit
Day 1
Form.html
Excellent. Inline CSS and JS is bad practice. Always create files and include them.
Day 2:
Tweets.html
1.