ruby-doc.org

...file by calling File.open(@file_path) {...

...} on the file directly instead. I will also include an example on how to use this for directories instead for files at the end...

...other database objects. Scenario You've got two database dumps: dump_a.pgdump dump_b.pgdump Both dumps include these tables: foobar barfoo foobaz You want to create a dump with: dump_a.foobar dump_b.barfoo

...buffer_size set to determine this limit. The default are two pages. This value includes the header buffers. There are two rules affecting the min and max values of proxy...

github.com

...When coming from jQuery, also see the card on JavaScript without jQuery. This card includes a link to You Don't Need jQuery, which summarizes most of the alternatives in...

stackoverflow.com

...your Ruby's source is located: gem install debugger-linecache -v '1.1.2' -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p448 Resume what you were doing before (probably a bundle install).

...need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib...

...with ActiveJob, the job arguments are logged. In case of a password reset, this includes the password reset token, which should not be logged. ActiveJob's logs can be disabled...

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 current environment: const { environment } = require('@rails/webpacker') const webpack = require('webpack...

uri = URI('https://api.chucknorris.io/jokes/random') res = Net::HTTP.get_response(uri) expect(res.body).to include('Paul') end end rspec spec/chuck_norris_spec.rb . Finished in 0.00759 seconds (files took 0.49565 seconds to load...

In contrast to RSpec's included allow_value matcher, the attached matcher will also work on associations, which makes it ideal for testing assignable_values. Usage example describe Unit do...

...expect(unit.assignable_buildings).to contain_exactly(building, other_building) expect(unit.assignable_buildings).not_to include(unauthorized_building, nil) end ... See RSpec: Where to put custom matchers and other support code

web.archive.org

...that follows after colon and ends at the line end (and this string may include quotes): When /^I fill in "([^"]*)" with: (.*)$/ do |field, value| pending # express the regexp above with...

Since Roadie is now in passive maintenance mode, we go with premailer: Include premailer in your Gemfile: gem 'premailer-rails' In your ApplicationMailer define the mailer layout:

...and only the mailer stylesheet) we have a separated mailer.js in webpack/packs where we include the css file für our mail styles: import '../application/stylesheets/mailer.sass' In your mailer.html.erb you can now...

...We want to use `GlobalID.create` to avoid constructing a GID # ourselves, and because it includes some sanity checks as well. pluck(*columns).map do |(id, type)| klass = anonymous_classes_by...

Ruby's standard library includes a class for creating temporary directories. Similar to Tempfile it creates a unique directory name. Note: You need to use a block or take care...

...const textReplace = require('esbuild-plugin-text-replace') const esbuild = require('esbuild') esbuild.build({ ... plugins: [ textReplace({ include: /jasmine-core\/lib\/jasmine-core\/jasmine\.js$/, pattern: [ ['let jasmineRequire;', 'let jasmineRequire; const global = window;'], ], }), ], })

These are the results of the "personal tech stack survey". I've included only the most popular mentions, maybe it can help you find one or two useful tools for...

VIM plugins Vim plugins are all over the place. Some multiple mentions include fzf.vim Fuzzyfinder integration with vim, allows for quick project wide file search. ALE (Asynchronous Linting...

...observers to add icons) small file size due to in-built ability to only include the icons you use (if you use webpack 2, or another packager with tree-shaking...

const FontminPlugin = require('fontmin-webpack') environment.plugins.append( 'Fontmin', new FontminPlugin({ autodetect: true, }) ) Only include the icons you need Fontmin-webpacker works by only keeping glyphs it sees in your...

...committing, you should always check the diff of your changes so you don't include any leftovers or irrelevant/bad changes. Any time spent on that is well invested as it...

...diff or git diff --cached (to diff staged changes), you can also have Git include the changes as a comment below the commit message: git commit -v That will open...

...this should not be an issue but it turns crazy if you try to include associated models deeper than 1 level: options = params.merge(:include => { :user => :avatar }) Post.paginate options When inspecting...

...the merged params you will get something like this: { :include=> { "user" => :avatar }, :page => 23 } Here the :user symbol in the hash of inclusions turned into a "user" string.\

Rails includes milliseconds in Time / DateTime objects when rendering them as JSON: JSON.parse(User.last.to_json)['created_at'] #=> "2001-01-01T00:00:00.000+00:00" In RSpec you might want...

rewrite_options is used by the ..._path methods in the views ^ module HostEnforcementTrait Include this method in a module because we cannot yield out of define_method module InstanceMethods...

yield ensure self.asset_host = old_asset_host end end as_trait do |*args| include HostEnforcementTrait::InstanceMethods options = args.first || {} methods = options[:for] around_filter :assets_have_urls, :only => methods

...extract_css: true 3. Change stylesheet_link_tag to stylesheet_pack_tag and javascript_include_tag to javascript_pack_tag 4. Replace image_tag with image_pack_tag if it...

...which parts of a library you want to import to your project. Many gems include everything because it was not possible otherwise. But now you can choose if you need...

developer.mozilla.org

...a webkitRelativePath property which lists the relative file path, starting from the selected directory (including it). Example: http://jsfiddle.net/xozvprdj/ Note that Chrome will show a confirmation prompt to make...

...HTML. As a fallback for older browsers you can use name (which won't include any path...

...these step definitions: Then /^I should not see an error$/ do (200 .. 399).should include(page.status_code) end Then /^I should see an error$/ do (400 .. 599).should include(page.status...

...poses some risk when you render user input, since it might be feasible to include data from the local filesystem into the PDF. Therefore, the usual XSS protection techniques should...