Bootstrap: How to avoid printing link URLs
By default, Twitter Bootstrap's print styles include printing links.
/* Bootstrap's way of printing URLs */
@media print {
a[href]:after {
content: " (" attr(href) ")";
}
}
If you want to turn that off Show archive.org snapshot , you can do
/* Don't print link hrefs */
@media print {
a[href]:after {
content: none
}
}
Related cards:
Webpack: How to avoid multiple versions of jQuery
To avoid multiple versions of a package, you can manually maintain a resolutions
section in your package.json
. We recommend you to do this for packages like jQuery. Otherwise the jQuery library attached to window
might not include the functi...
Rails: How to provide a public link in a mail
Lets say we have a user
with a contract
whereas contract
is a mounted carrierwave file.
Now we want to send the link to the contract in a mail. For this use case join the root_url
with...
Heads up: Angular may break links to the current URL (e.g. when using ngInclude)
Angular's location provider stalls links to the current URL, i.e. window.location. As soon as the $location service is activated in an Angular app, it will intercept links. The click event handler is registered in $LocationProvider.$get()
.
The...
How to make select2 use a Bootstrap 4 theme
select2 is a great jQuery library to make (large) <select>
fields more usable.
For Bootstrap 3 there is select2-bootstrap-theme.
It won't work for Bootstrap 4, ...
How to fix HTML elements being cut off when printing
When you print (or print preview) and elements are cut off (e.g. after 1st page, or "randomly") you should check your CSS rules for these:
- Is there an element with "
display: inline-block
" that surrounds your content? Make sure it has "`displa...
Rails: How to get URL params without routing parameters (or vice versa)
Rails' params
hash contains any request parameters (URL parameters or request payload) as well as routing parameters like :controller
, :action
, or :id
.
To access only URL parameters, use request.query_parameters
. Routing params are avai...
How to have a target=_blank link open with DevTools open
In the tab where you need it, open Chrome DevTools with F12, open settings with F1, scroll down to the "Global" section and check "Auto-open DevTools for popups".
When you follow a link with target=_blank within that tab, DevTools will be open an...
Cucumber: How to avoid VCR errors for unused requests in pending tests
When you have a pending Cucumber step (or feature) that also uses an existing VCR cassette, your pending test may fail at the very end with an error like this:
There are unused HTTP interactions left in the cassette:
- [get ...] => [200...
How to avoid raising RestClient exceptions for 4xx or 5xx results
When using RestClient to make an HTTP request, it will raise an exception when receiving a non-successful response.
HTTP status codes like 422 or 403 might be totally expected when talking to APIs, so plastering your code with `rescue RestClient::...
How to avoid ActiveRecord::EnvironmentMismatchError on "rails db:drop"
After loading a staging dump into development, you might get an ActiveRecord::EnvironmentMismatchError
when trying to replace the database (like rails db:drop
, rails db:schema:load
).
$ rails db:drop
rails aborted!
ActiveRecord::Environm...