...frame('iframe-id') do fill_in 'E-mail', with: 'foo@bar.com' fill_in 'Password', with: 'secret' click_button 'Submit' end Instead of the frame's [id] attribute you may also pass...

If you're also using Cucumber you could make a meta-step like this: When /^(.*?) inside the (.*?) frame$/ do |step_text, frame_id| page.within_frame(frame_id...

S3cmd is a free command line tool and client for uploading, retrieving and managing data in Amazon S3. S3cmd reads its configuration by default from ~/.s3cfg, which is created once...

...you run s3cmd --configure. If you have many configurations, we recommend to always specify the configuration you want to use. This prevents applying actions to the wrong bucket. Examples:

lucaguidi.com

...was typical approach for object oriented languages, designed in the 90s. A thread is sequence of instructions that can be scheduled and executed in the context of a process. Several...

...at the same time. Ruby’s VM process allocates a memory heap, which is shared and writable by threads. If incorrectly coordinated, those threads can lead to unexpected behaviors...

...you upgraded it everywhere. But because it's FreeBSD it does not restart running services. After every old version is removed from /var/cache/pkg you restarted collectd and it does not...

...start anymore, you really want to downgrade to 5.8.1 again. But even pkg now has 5.9.0 and you need your own make config setup anyway. portdowngrade Enter portdowngrade. Install it...

When you need the DOM node of a tag (e.g. to read extra attributes, or to modify the DOM near it), you can usually reference it via document.currentScript. However, document.currentScript is unsupported in ancient browsers, like Internet Explorer 11 or wkhtmltopdf's Webkit engine. If you are not running async scripts, you can easily polyfill it: document.scripts[document.scripts.length - 1] It works because document.scripts grows with each tag that was evaluated. That is also the reason why this solution will not work reliably for async code. Demo: https://codepen.io/foobear/pen/poRLxQm

stackoverflow.blog

...format ("2021-02-22T20:34:53.686Z") Google API guideline: https://google.aip.dev/ Numbers: String vs. Number The JSON number type is not a double. It's just a number...

...parsed as whatever the parser finds fitting. Pagination: Limit + Offset vs. Object ID / Pointer vs. System-Version Tables Filter Attributes e.g. ?fields=f1,f2,f3 Version in path (/api/v1/) or...

...with more than one developer should always consider to enforce code review even for small changes to improves the overall code health of the system. Here are some guidelines that...

...perfect pull request Google Google's Engineering Practices documentation Modern Code Review: A Case Study at Google Thoughtbot Thoughtbot' Code Review Guideline

jQuery is still a useful and pragmatic library, but chances are increasingly that you’re not dependent on using it in your projects to accomplish basic tasks like selecting elements...

...styling them, animating them, and fetching data—things that jQuery was great at. With broad browser support of ES6 (over 96% at the time of writing), now is probably a...

makandra dev

...Invoked Function Expessions (or IIFEs) to prevent local variables from bleeding into an outside scope: (function() { var foo = "value"; // foo is scoped to this IIFE })(); In Coffeescript an IIFE looks...

(-> foo = "value" # foo is scoped to this IIFE )() There is also a shorthand syntax with do: do -> foo = "value" # foo is scoped to this IIFE

apidock.com

2.ordinalize # => "2nd" 1002.ordinalize # => "1002nd" 1003.ordinalize # => "1003rd" -11.ordinalize # => "-11th" -1001.ordinalize # => "-1001st...

github.com

When CoffeeScript was added to Rails 3.1 they forgot one very important part, the ability to use it when responding...

...model inherits from others or uses many concerns / traits, it might be hard to see in the code which validators it has. But fortunately there's a method for that...

...UniquenessValidator:0x00007f55f1417e88 @attributes=[:name], @klass=UserGroup (call 'UserGroup.connection' to establish a connection), @options={:case_sensitive=>true, :scope=>:partner_id}>, #<ActiveModel::Validations::NumericalityValidator:0x00007f55f1415200 @attributes=[:user_count_limit], @options={:greater_than...

There are several gems that make it easy to read and process xlsx files. Parsing the entire file at once however is error-prone since each cell is transformed to...

...formatted but empty cells. As of today, I found two promising alternatives that provide a stream-based access to spradsheet rows: Roo supports multiple spreadsheet types like ODS or CSV...

...dependeny of capybara gem 'nokogiri', '< 1.6' # dependency of capybara gem 'rubyzip', '< 1' # dependency of selenium-webdriver, rubyzip 1+ requires Ruby 1.9 gem 'cucumber_factory' gem 'database_cleaner', '< 1'

...spinner', '~> 0.2.5' gem 'launchy', '~> 2.1.2' With these versions set, selenium-webdriver will be at version 2.35.1. This is because all later versions depend on rubyzip 1+. More info. After upgrading...

...image formats like JPG or PNG, each pixel is basically drawn on a fixed size canvas. To display such an image in a different size (say: 1.5 times larger than...

...Monitor) needs to interpolate the color values of missing pixels. The image will appear slightly blurred. This is different for vector graphics like the SVG (Scalable Vector Graphics) format. You...

...code from your repository. In order to do so, Capistrano connects to your repository server from the application server you're deploying to with SSH. For this connection you can...

...use two SSH keys: the user's ~/.ssh/id_rsa [default] the very same key you used for connecting to the application server - forwarded automatically to the git repository.

class Foo def bar(argument) 'Hello' + argument end end module FooExtensions def bar super(' in my') + ' World' end end class Foo prepend FooExtensions # the only change to above: prepend...

PostgreSQL and ActiveRecord have a good support for storing dynamic attributes (hashes) in columns of type JSONB. But sometimes you are missing some kind of validation or lookup possibility (with...

...plain attributes you can use Active Record's built-in validations and have your schema.rb). One approach about being more strict with dynamic attributes is to use JSON Schema validations...

...as expected with your Unpoly app. This is because your app only has a single page load when the user begins her session. After that only fragments are updated and...

...up.compiler('[track-for-analytics]', function($element) { var url = $element.attr('track-for-analytics') || location.pathname; ga('set', 'page', url); ga('send', 'pageview'); }); Finally look for containers that represent trackable content, and give...

awsdocs.s3.amazonaws.com

...aws-credential-file ./aws-credential.txt The output should look something like this: arn:aws:iam::322191361670:server-certificate/www.example.com arn:aws:iam::322191361670:server-certificate/testCert Now you have to upload...

...and includes the server certificate Amazon Resource Name (ARN) and GUID: arn:aws:iam::322191361670:server-certificate/www.example.com-2011 ASCACexampleKEZUQ4K If you got the error message similar to A client error...

gist.github.com

Here is some JavaScript code that allows you to click the screen and get the clicked element's text contents (or value, in case of inputs). The approach is simple...

...element. When you click the overlay, we look up the element underneath it and show its text in a browser dialog. You can then copy it from there.

...To reconfigure later, call s3cmd --configure. Once you're done setting up, s3cmd gives you shell-like commands like s3cmd ls or s3cmd del somefile.png. Here is a full list...

s3cmd accesslog s3://BUCKET Sign arbitrary string using the secret key s3cmd sign STRING-TO-SIGN Sign an S3 URL to provide limited public access with expiry

Let's say you have two screens: Show a given project Show a report for all projects Ideally you want both screens to be handled by different controllers like this...

...action ProjectsController#report. But these are all unsatisfying. What you can do is wrap the sub-resource in a collection block like you would do with custom collection actions:

...call model.save! after recreating versions. uploader.recreate_versions! does not update the model with the stored filename...