You are trying to use hex for installing dependencies but when you are behind a proxy you get the following message:
Request failed (404)
** (Mix) Package fetch failed and no cached copy available
You can use the following to set up hex (taken from the answer here:
mix hex.config http_proxy http://proxy.mycompany.com
Trying to start a new phoenix application while your node installation is old you get the following error:
Error: Brunch 2+ requires node v4.0+. Upgrade node or use older brunch for old node.js: npm i -g brunch@1 -g brunch@1
You will need to upgrade your node installation by following the steps below:
$> node -v
$> sudo yum install nodejs npm (if npm is not available)
$> npm cache clean -f
$> npm install -g n
$> sudo /path/n/was/installed(ie /home/kosmas/bin/n) stable
$> node -v
You are working on an existing rails project with many rubocop warnings and you would like to fix certain types or warnings by getting only the specified files.
So for example when you use rubocop you first get the following for all the files in the project:
799 files inspected, 17214 offenses detected
You can get a grouping of the errors by using the following:
rubocop --format offenses
If you would like to know only the files for a certain type of warning to be able to fix them you could try the following:
rubocop --only Style/TrailingWhitespace
..... list of files
799 files inspected, 386 offenses detected
You want to use some array method in a value returned, which can either be a single value or an array of values.
Rails ActiveSupport Array, provides a method called wrap, that can be used to:
Wraps its argument in an array unless it is already an array (or array-like)
Full explanation of the method here.
You would like to quickly convert a number from a different base system (i.e. binary, octal, hexadecimal), to decimal.
Use the echo $(()) shell command to convert it passing it the current base system and the number, as in $((2#101010)) or using the O for octal or 0x for hexadecimal notations.
echo $(( 16#FF ))
echo $(( 0xFF ))
echo $(( 8#21 ))
echo $(( 021 ))
Taken from Linux Journal’s Work the Shell column (March 2016)