web.archive.org

Restricting access to cookies is essential for security in many web apps. For example, the session ID, the secret token used to identify a particular session, is typically stored in...

...a cookie. Cookies have several important settings. Previously, I discussed the secure flag. This time, let’s dive into the cookie domain. The cookie domain is an important security feature...

...variations' was not found; perhaps you misspelled it? I just was hunting down a strange error with this model: class Model placeholder = 'variations' has_many placeholder nested_scope :verbose, :include...

...work (the latter returned [ :some_association, 'variations' ]). Eventually, the quotes led me to the solution: I had to write has_many placeholder.to_sym. When Rails can't find an association...

rubydoc.info

...hard to achieve), because it is no actual "integration testing". If you use this step, know what you are doing. Destroying a record with Capybara is not as easy as...

...user, method: :delete), because RackTest's visit can only perform GET requests. With this step you can destroy a records using either Selenium or RackTest. Example: When I destroy that...

Capybara will match elements outside of a page's tag. For example, the step definitions below match nodes in a page's : Then /^my browser should auto-discover the "([^"]*)" feed...

page.should have_css( 'head link' + '[rel="alternate"]' + "[href='http://www.example.com/#{slug}/feed.rss']" + '[title="RSS feed (all cards)"]' + '[type="application/rss+xml"]', visible: false ) end Then /^my browser should...

When you create e.g. a sidebar box that contains headlines and paragraphs, the final paragraph's margin in that box will create an undesired 'bottom padding' inside that box.

...is a Sass mixin that you can apply to such boxes. It makes the last child's bottom margin disappear: =hide_last_margin >*:last-child margin-bottom: 0

track down warnings and to see failing specs immediately or to get an overview of the core functionalities, you can use RSpec's "nested" format. It looks...

Tool validations should require model to be set should require place_id to be set #identifier should include the model and tag if the tool has a tag...

...default Ruby, RubyMine will give you incorrect inspections, for example.\ Here is how to switch which Ruby you use in RubyMine. File → Settings (Or press Ctrl+Alt+S)

...SDK and Gems" from the left pane Switch your "Ruby interpreter". Though it may seem you are changing a global setting here, this is in fact a per-project setting...

find . -cnewer other_file This can be used to check against a specific timestamp, too. This is how you check for all files modified today (since...

...the current bash's PID so you will get some file like /tmp/12345 that stays the same for the current shell. This allows you to check against this file again...

...you want to manually check if e-mail delivery works on a machine by sending an e-mail you can run the following: mail -s Test someone@example.com < /dev/null

...send an empty e-mail with "Test" as its subject to someone@example.com. If you want it to contain a message body, call mail -s Test someone@example.com only; the mail application...

askubuntu.com

Adobe no longer supports their PDF reader on Linux and the official page does not offer it for download. \ However, some files may not display properly on Ubuntu's default...

...PDF reader Evince or PDF forms may not work as expected. Hence, you may still need to use it. Here is how to install the Adobe Reader (acroread) if you...

There are several ways to merge two (or more) PDF files to a single file using the Linux command line. If you're looking for graphical tools to edit or...

...annotate a PDF, we have a separate card for that. PDFtk (recommended) PDFtk is a great toolkit for manipulating PDF documents. You may need to install it first (sudo apt...

Note that we used $ and ^ to explicitly look at the end and start of the filenames...

...git pull won't know its remote version. You could use difficult commands to set up a branch's tracking but it's easier to...

...just push it like this: git push -u From the documentation on git push: -u, --set-upstream For every branch that is up to date or successfully pushed, add upstream...

web.archive.org

...context) is run outside of transactions, so data created here will bleed into other specs before(:example) is run before each spec inside it, Generally, you'll want a clean...

...setup for each spec so that they are independent of other specs in the same context. Example Consider this spec: describe User, 'something' do before :context do @user = User.make

...clean out the database before each example. Use :transaction where possible. Use :deletion for Selenium features or when you have a lot of MyISAM tables. Understanding database cleaning

...to clean out your test database after each test, so the next test can start from a blank database. To do so you have three options: Wrap each test in...

Ubuntu has a package mysql-sandbox that lets you install multiple MySQL versions into your user home: Install mysql-sandbox sudo apt install mysql-sandbox Download the version of MySQL...

...you want to use from mysql.com: https://dev.mysql.com/downloads/file/?id=480427 Make sure to choose "Generic Linux" instead of "Ubuntu" so you get a .tar.gz instead of .deb cd into the directory...

makandra dev
tom.preston-werner.com

A perfect implementation of the wrong specification is worthless. By the same principle a beautifully crafted library with no documentation is also damn near worthless. If your software solves the...

...wrong problem or nobody can figure out how to use it, there's something very bad going on. Fine. So how do we solve this problem? It's easier than...

Here's a pretty useful steps that hasn't made it into Spreewald yet. It is best used with the auto-mapper for BEM classes in features/support/selectors.rb

...above [selector] element When /^I hover above (.*) element$/ do |selector| page.find(selector_for(selector)).hover end Example: When I hover above the album's image element → triggers a hover event...

...run our end-to-end tests with headless Chrome. While it's a very stable solution overall, we sometimes see the headless Chrome process freeze (or the Capybara driver losing...

...connection, we're not sure). The effect is that your test suite suddenly stops progressing without an error. You will eventually see an error after a long timeout but until...

We use CarrierWave in many of our projects to store and serve files of various formats - mostly images. A common use case of CarrierWave's DSL is to "process" the...

...versions", for example different resolutions of the same image. Now we could go one step further: What if we want to create versions that have a different file extension than...

...binary, do not install Ubuntu's node package. Instead, you need to create a symlink that points to the binary one of the nodejs package: sudo ln -s /usr/bin/nodejs /usr/bin/node...

...You probably already installed NodeJS. In case you did not: sudo apt-get install nodejs If you already installed the node Ubuntu package, bower will just do nothing (i.e. not...

...disable hiding URL parameters, open up Tools → Preferences (Ctrl+F12) → Advanced → Browsing and check "Show full web address in address field". No need to touch opera:config. The badge that...

...displays the page's "zone" (Web, Secure, Opera, ...) will be shrinked so you can still see a yellow lock for proper SSL connections, etc...

...nested projects. Then it's really helpful! This makes use of the CDPATH variable. Similar to the PATH variable, which holds the list of directories which are searched for executables...

Then add the following to your ~/.bashrc: export CDPATH=.:~/.bookmarks/ function mark { ln -sr "$(pwd)" ~/.bookmarks/"$1" } # Always resolve symbolic links (e.g. for bookmarks) alias cd="cd -P"

When using custom properties in your stylesheets, you may want to set a specific property value to an existing variable in your SASS environment. A pratical example would be a...

...existing quotes, you may use the meta.inspect() function: @use "sass:meta" $my-cool-font: "Roboto", sans-serif :root --font-family-sans-serif: #{meta.inspect($my-cool-font)} Unfortunately, the output of...