Solution: Ubuntu distros lower than 18.10 will not work in this laptop, as minimum kernal version required is 4.18.
So install ubuntu 18.10 / xubuntu 18.10 / lubuntu 18.10 / kubuntu 18.10 in UEFI mode
| /* | |
| * Handling Errors using async/await | |
| * Has to be used inside an async function | |
| */ | |
| try { | |
| const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
| // Success 🎉 | |
| console.log(response); | |
| } catch (error) { | |
| // Error 😨 |
| # routes.rb | |
| match 'ads/:id/present/*path.:format', :to => 'ads#present' | |
| # ads_controller.rb | |
| def present | |
| @ad = Ad.find(params[:id]) | |
| path = "#{params[:path]}.#{params[:format]}" | |
| send_data(@ad.get_file(path), :filename => path, :disposition => 'inline') | |
| end |
| http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query | |
| http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails | |
| #payload: [{"kind"=>"person"}] | |
| Segment.where("payload @> ?", [{kind: "person"}].to_json) | |
| #data: {"interest"=>["music", "movies", "programming"]} | |
| Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json) | |
| Segment.where("data #>> '{interest, 1}' = 'movies' ") | |
| Segment.where("jsonb_array_length(data->'interest') > 1") |
Solution: Ubuntu distros lower than 18.10 will not work in this laptop, as minimum kernal version required is 4.18.
So install ubuntu 18.10 / xubuntu 18.10 / lubuntu 18.10 / kubuntu 18.10 in UEFI mode
| Array values in the parameter to `Gem.paths=` are deprecated. | |
| Please use a String or nil. | |
| An Array (...) was passed in from bin/rails:3:in `load' | |
| Solution | |
| ======== | |
| https://github.com/rubygems/rubygems/issues/1551 | |
| If you came to this issue by googling the error specified in the description of this issue, you should know that it has already been fixed in spring-1.6.4 and all you need to do is to update to latest spring and regenerate binstubs, like this: |
| worker_processes 1; | |
| events { | |
| worker_connections 1024; | |
| } | |
| http { | |
| # passenger_root /home/deployer/.rvm/gems/ruby-2.3.3/gems/passenger-5.1.0; | |
| # passenger_ruby /home/deployer/.rvm/gems/ruby-2.3.3/wrappers/ruby; |
| # По умолчанию запускаем только необходимых для тестов наблюдателей, | |
| # то есть всех, кроме server. | |
| # Для запуска всех: bundle exec guard -g default | |
| scope groups: ['specs'] | |
| group 'specs' do | |
| # запускаем тесты и использованием Spring | |
| guard :rspec, cmd: "bundle exec spring rspec" do | |
| require "guard/rspec/dsl" | |
| dsl = Guard::RSpec::Dsl.new(self) |
| #!/usr/bin/env ruby | |
| ADDED_OR_MODIFIED = /^\s*(A|AM|M)/.freeze | |
| changed_files = `git status --porcelain`.split(/\n/) | |
| unstaged_files = `git ls-files -m`.split(/\n/) | |
| changed_files = changed_files.select { |f| f =~ ADDED_OR_MODIFIED } | |
| changed_files = changed_files.map { |f| f.split(" ")[1] } |
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |