How to find out a pixel's transparency with Gimp
If you have a PNG and want to know a pixel's alpha channel value, you can use Gimp:
- Use the color picker tool
- Hold the
Shift
key while clicking the pixel
A window will appear, containing color information, including the alpha channel.
Related cards:
How to find out the type of a model's attribute
When you want to find out the data type of an attribute, you can just use ActiveRecord's columns_hash
method.
It returns a hash of column objects that include a type
attribute (and more database-related information).
Example:
Contract.c...
How to use Simplecov to find untested code in a Rails project with RSpec and Cucumber
Simplecov is a code coverage tool. This helps you to find out which parts of your application are not tested.
Integrating this in a rails project with rspec, cucumber and parallel_tests is easy.
- Add i...
How to find out what is running on a port on a remote machine
By convention, common protocols use a defined port, like 80 for HTTP or 443 for HTTPS.
You can use nmap
to find out what service is running behind a given port, and most often see some details about it. This can be helpful if servers don't offe...
How to reduce a video's file size with ffmpeg
Using ffmpeg, you can easily re-encode a video to reduce its file size.
Command
Do it like this:
ffmpeg -i input.mp4 -c:v libx264 -crf 23 -preset slow -c:a copy -movflags +faststart output.mp4
Arguments
-
-i input.mp4
specifie...
How to find child nodes that match a selector with JavaScript
Using querySelector
or querySelectorAll
in JavaScript, you can easily find descendants of a node that match a given selector.
But what if you want to find only children (i.e. direct descendants) of an element?
Easy: use :scope
. It referen...
How to find out the currently focused DOM element with JavaScript
This works in all relevant browsers:
document.activeElement
You can use this in your Selenium steps, for example, to assert that a form field is or is not focused.
How to find out your Ubuntu's release codename or version
So you want to know if you are on natty
, precise
, quantal
, or something else? Check /etc/lsb-release
.
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"
``...
How to: Run geordi in a single proccess with parallel test setup
Geordi uses parallel_tests if available for running the test suite. To debug an application it is very unhandy to have multiple processes as your terminal I/O will ...
Google Chrome: How to find out your currently installed theme
So you downloaded a theme for Chrome a while ago and don't remember which one it is?
You can go to chrome://settings/appearance
(on Chrome 61+) to see the theme's name, and click a link to open it in the Chrome Web Store.
If you are on an olde...
How to find out which type of Spec you are
When you need to find out in which kind of spec you are during run-time, it's definitely possible. It's a lot easier in RSpec 2+.
For example, consider this global before
block where you'd want to run some code for specific specs only:
c...