CSS 100% width minus paddings, margins and border

img{
	width: 100%;
	background-color: #fff;
	box-shadow: 0 8px 6px -6px rgba(0, 0, 0, 0.8);
	border: thin solid #ccc;
	padding: 10px;
}

The code above gives this result:
2014-07-17_css_box_model_no

As you can see, the 100% width plus 10px padding exceeds the actual available width, so here is the correct code how it should be:

img{
	-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
	-moz-box-sizing: border-box;    /* Firefox, other Gecko */
	box-sizing: border-box;         /* Opera/IE 8+ */
	width: 100%;
	background-color: #fff;
	box-shadow: 0 8px 6px -6px rgba(0, 0, 0, 0.8);
	border: thin solid #ccc;
	padding: 10px;
}

2014-07-17_css_box_model_yes
In this example the image with its paddings, margins and border fits inside the available container and 100% is not exceeding it.

More on this topic: http://css-tricks.com/box-sizing/

Joomla 3 pagination localisation

2014-06_20_joomla_lv_pager

Joomla 3 LV language pack does not have full support for articles pagination.
The strings that are not translated are in en-GB.lib_joomla.ini file. However, there is nosuch file for Latvian. I had to create lv-LV.lib_joomla.ini, paste contents of appropriate EN file and translate corresponding lines, like:
JLIB_HTML_START="Start"
to
JLIB_HTML_START="Pirmā"

htaccess allow IP addresses

If your website is under construction, you can simply edit .htaccess file to disallow visits to your website.
Here is the code :
<Limit GET POST PUT>
order deny,allow
deny from all
allow from 12.345.67.890
</Limit>

allow from 12.345.67.890 command allows access to your server only from 12.345.67.890 IP address.

You can allow more IP’s to access your website :
<Limit GET POST PUT>
order deny,allow
deny from all
allow from 12.345.67.890
allow from 890.67.345.12
</Limit>

This practice is good in case you are modifying your website (performing a new joomla installation) and don’t want others to see the process.

Original source: http://htaccessfile.com/htaccess-allow-ip-addresses

How to download a complete website

If you ever need to download an entire Web site, wget can do the job:
wget \
--recursive \
--no-clobber \
--page-requisites \
--adjust-extension \
--convert-links \
--restrict-file-names=windows \
--domains example.com \
--no-parent http://example.com.lv/thefolder/

The options are:
--recursivedownload the entire Web site.

--domains example.com don’t follow links outside example.com.

--no-parent don’t follow links outside the directory thefolder/.

--page-requisites get all the elements that compose the page (images, CSS and so on).

--html-extension save files with the .html extension.

--convert-links convert links so that they work locally, off-line.

--restrict-file-names=windows modify filenames so that they will work in Windows as well.

--no-clobber don’t overwrite any existing files (used in case the download is interrupted and resumed).

Also note that in wget 1.12, –html-extension is renamed to –adjust-extension

The orignal resource: http://www.linuxjournal.com/…