$ gem list rails
*** LOCAL GEMS ***
rails (4.2.0, 4.2.0.rc1, 4.2.0.beta2, 4.1.8, 4.1.7, 4.1.6)
$ rails _4.2.0_ new foo
Error: Command '_4.2.0_' not recognized
Did you mean: `$ rake _4.2.0_` ?
Usage: rails COMMAND [ARGS]
...
i love those stories about interviews. until now, i was lucky enough not having to had to experience such bullshit interview. the stupidest thing was "yeah, we really want you but please wait 6 months 'til we hired a senior." -- after 3 rounds of oral and whiteboard tests.
i ended up with my current position without an interview and for the foreseeable future i don't plan to ever have one again. unless "apple calls" and this won't be happening ;)
great. without digging into it i always wondered how to achieve this. thanks.
might come in handy for my plans for Starve ;)
you're welcome.
On Starve i use this simple version:
jQuery(document).on('ready page:change', function() { … })
Covers both events and allows the use of an anonymous function at the same time.
Also, from my understanding page:change
is the earliest event to run javascript on the site (though we're talking about nanoseconds here ;) ).
that last thing (let's call this closure an "anonymous scope") is totally valid given it is put in the right place. this construct is also considered best practice in javascript world to encapsulate your code from the global scope.
if you run it at the end of the page, you should not have any problems.
Also, the closure lacks an argument variable to hold the jquery reference you passed in (although it would work anyway :p).
You can even combine this with .noConflict()
and use $
inside the closure at the same time:
(function($){
// code
})(jQuery.noConflict())
i'd suggest a variant of the
gem install
command that does not depend on a specific version of mysql.it should even be possible to be simplified down to
because the
extconf
will derivemysql-lib
andmysql-include
from themysql-dir
argument.and if you know you have a working
mysql_config
you should be able to use justand
extconf
will call it with arguments to extract proper flags: