...at the wrong location, you can rename the requiring CSS file to .css.scss, turn calls to url into font-url (requires SASS) and pass a valid path to that font...
should find tools by model and maker should find tools by serial number Call RSpec like this in order to use the nested format: spec spec -f documentation
puts "Hello" end end While you can say create a block to call that method (using ampersand and colon) on Ruby 1.8, ... 1.8.7 > Foo.new.tap(&:test) Hello => # ... you cannot...
...do that on Ruby 1.9 or 2.0: 1.9.3 > Foo.new.tap(&:test) NoMethodError: private method `test' called for # ^ 2.0.0 > Foo.new.tap(&:test) NoMethodError: private method `test' called for #Foo:0x000000027bc738
...the conversation, use /alertson KEYWORD Note that multiple keywords must be defined with one call, as each call will overwrite previous keywords. Separate them by spaces: /alertson KEYWORD1 KEYWORD2
...I use this handy shell script to set one site as the current one. Call it just like this: apache-site makandra-com Note that it disables all other sites...
...Furthermore it will also enable the default site if that was available. When you call apache-site with no arguments, it will list all available sites. This script is part...
...outfile out.pdf one.pdf two.pdf Pages from joined documents might be rotated. To avoid this, call it like this: pdfjam --outfile out.pdf --fitpaper true --paper a4paper --rotateoversize false one.pdf two.pdf
If a SOAP API expects you to call a remote method with arguments of complex types, Savon lets you manually set the xsi:type attribute like this: client.call(:rpc_method...
puts body.body # html of response body Instead of Rails.application you can also call any Rack application...
...elastic did not recover. I had to explicitly disable readonly via the following REST call: curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null...
...block. You can use Object#method to obtain a method reference that responds to #call: foo_plus = "foo".method(:+) foo_plus.call("bar") # => "foobar" The method reference also understands #to_proc so...
...defined via the resource method. When you put resource 'user' into config/routes.rb, you can call users_path and get the path to the index action in the UsersController: /users.
...states, Rails creates a special _index_path for this scenario. Thus, you can simply call: sheep_index_path
Starting from Rails 4.0, you can use a special form options helper called #collection_check_boxes. It behaves similar to #collection_select, but instead of a single select field it...
You can customize the output by passing a block. The block will be called with a special builder object that has a handful of special methods. See the complex...
...RestClient.get or RestClient::Request.execute. In that case, RestClient will not raise an error, but call the block with 3 block arguments: a RestClient::Response the RestClient::Request for your request...
...an underlying Net::HTTP result, e.g. Net::HTTPUnprocessableEntity The called method will then return the return statement of the block. So this will just return the response object of a...
In order to prove multiple values from a single object, Ruby calls #to_a on the object: o = String.new('O') def o.to_a [1,2,3]
...a, b, c = o # Implicit call to #to_a here a # => 1 b # => 2 c # => 3 Hence, if you want your class to support multiple assignment, make sure to define...
Ruby 1.9 brings a shorter way to define lambdas using the -> operator: twice = -> (x) { 2 * x } twice.call(5) # => 10
...your recompile hit. To dig further, you may add options to the new SpeedMeasurePlugin call. Example: const smp = new SpeedMeasurePlugin({ outputFormat: "humanVerbose", loaderTopFiles: 20 }) const config = environment.toWebpackConfig() module.exports = smp.wrap(config...
...a "read on" link), and html_safe knowledge. Prefer the truncate() helper Warning: truncate() calls html_safe if you're not escaping. FWIW, an HTML string may easily become invalid...
...Rail application. Upgrading the gem to version 1.21.0 fixed the issue. Traceback (most recent call last): 17: from /home/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/sshkit-1.9.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute' 16: from /home/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb...
...So if your project doesn't support Rails-XSS just remove all .html_safe calls.
...Ruby version only to make the release, then switch back. You will have to call the rake release command without bundle exec...
Call geordi clean from a project root to remove unused and unnecessary files inside it. This script is part of our geordi gem on github. In Geordi > 1.2 you can...
...call geordi clean...
The only way that a jQuery cache entry gets deleted is when you call remove() on the element that put it there! Since cache entries also have a pointer...
...pointer in the jQuery cache blocks its memory from being reclaimed. You need to call $element.remove() (or remove a parent element), to remove the entry in the jQuery cache and...
If you have multiple monitors and want to share a given screen with your call partner, drag the caller window to the desired monitor, then start sharing.
...possible security vulnerabilities caused by this. If you want to find out if the call was successful you can ask $?.success?. system – when you want to know how it went...
...server', '-p 3000' # fails and returns nil This is equivalent to running a command called "bundle exec rails" (including spaces in its filename). There is usually no such command anywhere...