To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
Options included below:
docker-composebrewThis gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew any longer. Instead consider adding a barebones docker-compose.yml for each project and run docker-compose up to start each project's mysql service.
Originally published in June 2008
When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.
To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.
Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.
| # username = "my_username" | |
| # pwd = "my_password" | |
| # target_path = "my_target_path" | |
| # saving auth cookie | |
| system %Q{wget --save-cookies /tmp/cookie.txt --keep-session-cookies --post-data "username=#{username}&password=#{pwd}" -O - \ | |
| https://rubytapas.dpdcart.com/subscriber/login?__dpd_cart=d08391e6-5fe2-4400-8b27-2dc17b413027} | |
| (25..600).each do |i| |
By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:
/people/6
But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.
| # lib/active_admin_views_pages_base.rb | |
| class ActiveAdmin::Views::Pages::Base < Arbre::HTML::Document | |
| private | |
| # Renders the content for the footer | |
| def build_footer | |
| div :id => "footer" do | |
| para "Copyright © #{Date.today.year.to_s} #{link_to('Example.com', 'http://example.com')}. Powered by #{link_to('Active Admin', 'http://www.activeadmin.info')} #{ActiveAdmin::VERSION}".html_safe |
| Sete Atitudes para Hackear a Indústria de Software | |
| By Klaus Wuestefeld | |
| 1) Torne-se excelente. | |
| Seja realmente bom em alguma coisa. Não fique só choramingando ou | |
| querendo progredir às custas dos outros. Não pense q pq vc sentou 4 | |
| anos numa faculdade ouvindo um professor falar sobre software q vc | |
| sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo |