Rails Active Support provides some helpful methods for calculating times and dates, like Duration#ago or Duration#from...

makandra dev

Option 1: JSON dump In config/webpack/environment.js you can get inspect environment which includes all webpack config options set for the...

makandra dev
github.com

...About Exception#cause Ruby 2.1 has a built-in mechanism with Exception#cause, which serves a similiar purpose as Nesty. However, any code printing your stack trace (Exception Notifier, Airbrake...

When your Rails application offers downloading a bunch of files as ZIP archive, you basically have two options:

Code snippet tested with Rails 2.3 def index # ... if request.xhr? html = render_to_string(:partial => "list", :layout => false) respond_to...

...s possible you get this "error" message: *** [err :: example.com] There are no Phusion Passenger-served applications running whose paths begin with '/var/www/example.com'. *** [err :: example.com] This is just because there were...

...no running passenger instance on the server. It's not a real error...

If you make a gem with Bundler, you will get a rake release task that will instantly publish your gem...

I prefer the application that I'm currently working on to be reachable at http://localhost/. So when I switch...

If you get errors from your development WEBrick that contain unicode salad, you are probably requesting the page via SSL...

A memory leak is an unintentional, uncontrolled, and unending increase in memory usage. No matter how small, eventually, a leak...

We're adding a script console-for to open a remote Rails console with one command. Also have a look...

If your rails application is unable to send mails, it might be useful to debug your settings using the rails...

...and link it to /etc/apache2/sites-enabled with something like the following ^ NameVirtualHost *:80 <VirtualHost *:80> ServerName application.local DocumentRoot /opt/application/public RailsEnv development RailsAllowModRewrite off <VirtualHost *:443> ServerName application.local DocumentRoot /opt/application/public RailsEnv development...

...to the instructions provided at the end of the setup script. Restart Apache: sudo service apache2 restart This also works when you previously ran your Passenger using MRI. Just run...

To ensure Spring is not running: bin/spring stop pkill -f spring To prevent Spring from starting again: export DISABLE_SPRING...

gnuu.org

YARD 0.6 adds the ability to serve documentation for gems as well as the current project with yard server. Just like gem server in RubyGems, you can serve gem docs...

...The advantage to YARD’s server is that you don’t need to pre-generate the static docs (with a gem install) before running the server. If you installed your...

makandra dev

...target machine: ssh remote-machine sudo vim /etc/ssh/sshd_config Set X11Forwarding yes and save sudo service sshd reload (existing connections will not be terminated...

When you have a program running in a hidden X screen (like with Xvfb for Selenium tests) you may want...

...your config/environments/development.rb: config.middleware.insert_after(ActionDispatch::Static, Rack::LiveReload) Run guard init livereload. Restart your server. Use CSS live reload Run guard -P livereload in a console, and keep it open...

Geordi now has a script that runs capistrano with all known deploy targets (i.e. staging, production...). Use with geordi capistrano...

...work, we prefer another solution now: Hide your Selenium browser window with a VNC server. If you would like to hide the annoying selenium browser window that always gets the...

makandracards.com

revisions << capture(:cat, 'REVISION').strip end end # Never skip asset compile when servers are running on different code next if revisions.uniq.length > 1 changed_files = `git diff --name-only...

Sometimes you want to see what data you get through a TCP or UDP connection. For example, you want to...

makandra dev

Ubuntu lets you mount an SSH shell into Nautilus from Places -> Connect to server (select "SSH" as server type). In order to copy a file over SSH from a shell...