Consider this Sass: .comment width: 320px; height: 240px; Any textarea with the comment class will be sized 320 by 240 pixels. In WebKit browsers (Chrome, Safari, ...) or Firefox, this is...
...only the initial size -- users can resize textareas to become bigger. This is helpful to the user, but may be breaking your application layout in some cases.
Variables are colored in the console output You don't need to stringify arguments so the + operator doesn't explode If the variable is a structured object like...
...inside the console and look at its contents Another concise way to write the statement is this: console.log({ foo, bar }); This uses Javascript's new destructuring syntax and is actually...
...exciting" case of auto-loading classes inside a thread which caused the application to stop responding. Rails 4.x ActiveSupport::Dependencies includes logging support. It is easy to use:
...Dependencies.logger = Rails.logger Rails 5+ Logging support was removed for Rails 5. You need to manually patch yourself into the module's code. Here is a dirty solution that works.
...some non-default behavior that you know from other tags. Do not try to style html or body for positioning, width/heigth, or similar. Every browser has its own caveats and...
...you can not test them all. Generally speaking: Use the html tag to define your page's default background color (because on short pages or large screens, your body may...
sslscan is a nice tool to show details about TLS/SSL connections: ~> sslscan some-host-at.makandra.de Testing SSL server some-host-at.makandra.de on port 443 Supported Server Cipher(s): Failed SSLv3 256 bits ECDHE-RSA...
...AES256-GCM-SHA384 Failed SSLv3 256 bits ECDHE-ECDSA-AES256-GCM-SHA384 Failed SSLv3 256 bits ECDHE-RSA-AES256-SHA384 Failed SSLv3 256 bits ECDHE-ECDSA-AES256-SHA384 Rejected SSLv3...
...When your tests involve a Rails test application, your tool's Bundler environment will shadow that of the test application. To fix this, just call unset_bundler_env_vars in...
...a Cucumber Before block. Previously suggested solution Put the snippet below into your tool's features/support/env.rb -- now any command run through Aruba (e.g. via #run_simple) will have a clean...
...Rails 2 applications that use RSpec, so don't upgrade if that is your setup. The rspec-rails gem has a fatal bug that was only fixed for rspec-rails...
...x, which only supports Rails 3. There is no fix for the rspec-rails-1.3.x series of the gem which supports Rails 2. Anyway, here are upgrade instructions if...
...but REST itself - in a nutshell. so here's a new angle i've started playing with: "REST Upside Down...
...fully integrate your Dropbox account(s) into nautilus (Gnome's file manager) with automatic synchronization. Get the .deb file for your system architecture (32 or 64 bit) from the Linux...
...Install the downloaded package using either the Gnome integration (double-click it) or the shell, e.g.: dpkg -i nautilus-dropbox_?.?.?_amd64.deb Follow the graphical installer (use the custom installation for...
...Sometimes you have search entries in the autocomplete of the address bar, which are higher weighted than your bookmarks. Pressing SHIFT + DEL while searching removes them from the history immediately...
...Sometimes you have search entries in the autocomplete of the address bar, which are all higher weighted than your recently visited sites. Add a search for your history, so you...
...we noticed your project(s) has not accessed or used the YouTube Data API Service in the past 60 days. For reference, your inactive project number is ... While projects do...
...only tell you its (generated) number. But if you use the API Console's search, you won't get any results for project numbers. Also, project numbers are not visible...
I had some problems with Git and the file spec/fixtures/ČeskýÁČĎÉĚÍŇÓŘŠŤÚŮÝŽáčďéěíňóřšťúůýž. After pulling the latest commits, it would show that file as untracked, but adding and committing it would throw...
...unicode fixture file once again' did not match any file(s) known to git. Solution Install Git version > 1.8.2 using homebrew and set git config --global core.precomposeunicode true Done.
When building a form with a file select field, you may want to offer your users a live preview before they upload the file to the server. HTML5 via jQuery...
...Luckily, HTML5 has simple support for this. Just create an object URL and set it on an tag's src attribute: $('img').attr('src', URL.createObjectURL(this.files[0])) Unpoly Compiler
...that happens on your local machine Manually remove the offending's gem files and specifications. The paths will be something like /usr/lib/ruby/gems/1.8/gems/your-broken-gem and /usr/lib/ruby/gems/1.8/specifications/your-broken-gem Update Rubygems or Slimgems by running...
...gem update --system Run bundler on your project to reinstall the offending gem. If this happens to your during deployment Ask your operations team to do it. After the update...
If your Webpack build is slow, you can use the Speed Measure Plugin for Webpack to figure out where time is being spent. Note that at time of writing, Webpack...
...now have an idea where optimization might be feasible. Look around for suggestions, e.g. the sass-loader readme when you want to optimize Sass build time...
...on an old version of ImageMagick that you can no longer install in your system, you can choose the run an old ImageMagick in a Docker container. Dockerized ImageMagick commands...
...path arguments. You need to boot a corresponding docker container once before using it. Setting up Docker If you haven't installed Docker yet, use our guide or the official...
This post is not about devops, it's not about lean startups, it's not about web scale, it's not about the cloud, and it's not about continuous...
Find conditions for scopes can be given either as an array (:conditions => ['state = ?', 'draft']) or a hash (:conditions => { 'state' => 'draft' }). The later is nicer to read, but has horrible security...
...versions of Ruby on Rails. Affected versions Version Affected? Remedy 2.3.18 yes Use chain_safely workaround 3.0.20 no 3.1.x ??? 3.2.22 yes Use Rails LTS 3.2 with hardened configuration...
Webfonts are not always available when your JavaScript runs on first page load. Since fonts may affect element sizes, you may want to know when fonts have been loaded to...
...Promise that will be resolved once the font is available. Example: document.fonts.load('1rem "Open Sans"').then(() => {...
jQuery / fontSpy If your project uses jQuery, you could also use jQuery-FontSpy which...
Let's say you have two XML strings that are ordered differently but you don't care about the order of attributes inside containers: a = ' batman secret ' b = ' secret batman...
...Working with plain string comparison is not helpful, of course: a == b => false Instead, you can use the Nori gem to convert your XML into a hash: xml_parser = Nori.new...
When you set both a record's association and that association's foreign key attribute, Rails does not realize you are talking about the same thing. The association change will...
...win in the next save, even if the foreign key attribute was changed after the association. As an example, assume you have these two models: class Group < ActiveRecord::Base
fake_stripe spins up a local server that acts like Stripe’s and also serves a fake version of Stripe.js, Stripe’s JavaScript library that allows you to collect your...
...customers’ payment information without ever having it touch your servers. It spins up when you run your feature specs, so that you can test your purchase flow without hitting Stripe...
...needed a way to make my apps full screen from bash scripts. There is no super-easy way, but it's not too hard either. Put the attached script into...
...e.g. /usr/local/bin and make it executable. Now you can call fullscreen Safari and Safari will go full screen. Notes This script needs activated access for assisting devices. Turn it on...
...an npm package. Naming convention for pre-release versions An npm package must use Semantic Versioning's naming convention for its version. In Semantic Versioning, the version number and pre...
...release identifier (like rc1) must be separated by a dash, like this: 1.0.0-rc1 2.3.0-alpha2 3.0.0-beta3 Publishing to a pre-release tag npm packages have multiple "current" releases...