unpoly.com

Version 3.7.0 broke some things in complex forms. Sorry for that. Concurrent user input is hard. 3.7.1 This change fixes...

JavaScript objects can have getter and setter functions that are called when a property is read from or written to...

The gemspec for gems allows to add metadata to your gem, some of which have a special meaning and are...

apidock.com

Note: ActiveRecord::Base#becomes has a lot of quirks and inconsistent behavior. You probably want to use ActiveType.cast instead. ActiveRecord models have with a method becomes(klass) which you can...

Ctrl + Alt + S > search "rubocop on save" Under "Inspections", check the highlighted box on rubocop -a Caveat: This adds a...

OpenAI is currently limiting the Audio generating API endpoint to text bodies with a maximum of 4096 characters.

makandra dev

...lib provides a built-in email regex URI::MailTo::EMAIL_REGEXP. That's the best solution to work with. /\A[a-zA-Z0-9.!\#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA...

Partials always define a local variable with the same name as themselves. E.g. when you are in _recent_users.html.erb, a local...

adobe.com

Flash movies (.swf files) can talk with Javascript code embedded in the same HTML page. There are two ways to...

It is quite easy to migrate from CoffeeScript to ES6. You can use decaffeinate to convert your CoffeeScript source to...

Using Ruby 1.8.7 you will not be able to use the maximum versions Rubygems 1.8.30 and Bundler 1.17.3 with https://...

I recently noticed that better_errors allows you to to open files from within your favorite editor. However it was not so easy to get rubymine:// links to work on...

...Does xdg-open "rubymine:///etc/hosts" open the hosts-file in RubyMine? Step 4: Tell better_errors to use your opener The BETTER_ERRORS_EDITOR_URL environment variable can be used...

To run additional code before an existing Rake tasks you can add a dependency like this: task :before_task...

getpostman.com

Talking with APIs makes more fun using Postman. As an alternative you can also use command line tools like cURL...

Using Capistrano, we usually have some array configurations in the config/deploy.rb file, like set :linked_files, %w[config/database.yml], so in...

Element finding is a central feature of Capybara. Since #find is normally used to get elements from the current page...

To use a form model with devise, you can simply override #resource_class in a controller. A typical use case...

When you need to find out in which kind of spec you are during run-time, it's definitely possible...

Note Using rem only ever makes sense when the root font size is dynamic, i.e. you leave control to the...

...is a fix to SafeBuffer#gsub. Note that it will only fix the $1 behavior, not give you a safe string in the end (see below). Example def test(input...

...really expect outside code (read: Gems) to not use $1 (and there is plenty, believe me) when calling gsub on an input that may be a SafeBuffer, you need to...

...reject_if: :all_blank # Ignore the blank template record end class Image < ActiveRecord::Base belongs_to :gallery mount_uploader :teh_image, YourUploaderHere # Mount Carrierwave on attribute :teh_image end

...to automatically fix the whitespace, see below. (Note that this might lead to unexpected behaviour e.g. in Markdown documents.) The global git hooks live in $PREFIX/share/git-core/templates/hooks (where $PREFIX is probably...

So you added a new callback to your model that (e.g.) caches some data when it is saved. Now you...

makandracards.com

...of time, but it will always be retried at least a second time. This behavior allows with_scope to be patient, and it must be patient, as explained below.