I allways forget how to extract a *.tar.gz file from command line on Linux, so I have to write it down.

Example of extract tar file:

tar -xvf file.tar.gz

Where:
x extract
v verbose output (prints all extracted files)
f specify input filename
z decompress

Example of creating archive with tar:

tar -cvzf compressed_file.tar /path/to/directory

Where:
c create archive
v verbose output
f specify output filename
z compress

Other examples:
Create compressed archive with three files from separate directories:

tar -cvzf compressed_file.tar /path/to/file1 /path/to/file2 /path/to/file3

Read More →

General:
Return true if all function returns are true.
If there is at least one false returns false.

Similar to And function but gives the opportunity to execute an additional function

Val1 And Val2 And Val3 ...

Returns true when:

(true And true And true And true) = true

Returns false when:

(true And false And true And true) = false

Erlang code:

Verdicts = [true, true, false, true].
Verdict = lists:all(fun(Elem)->Elem end, Verdicts).

Where:

fun(Elem)->Elem

returns the element of a list

More complex example:
We have a list with tuples:

{day_of_week_atom, Temeprature_value}

and we want to check if it was a warm week (temperature above 20 degrees of Celsius)

List = [{monday,21},{tuesday,22},{wednesday,6},{thursday,22},{friday,21}].
	lists:all(fun({_,Temperature})-> Temperature >= 20 end, List).

Tip:
Function is executed on each element of a list until first false is returned.
So for above example it will be executed for Monday, Tuesday and Wednesday

It is very annoying when you try to develop a new application in Codeigniter, but your environment is misconfigured. It often happens when I install a new instance of WAMP Server and it have a default configuration.

A very common problem with Codeigniter is that index.php must be present in url to run your controller code e.g:
http://loclahost/codeigniter_project/index.php/welcome/
so it is not a very nice loking and we would prefer something like this:
http://loclahost/codeigniter_project/welcome/
So what’s the sollution ? – Propperly configure ModRewrite

This is step by step sollution, how to configure WampServer to propperly run CodeIgniter:

1.  Edit httpd.conf to turn on the Rewrite module in Apache server:
Uncomment line: LoadModule rewrite_module modules/mod_rewrite.so and restart Apache.

2. Add .httaccess file to your codeigniter_project root folder:
Create new file with name .htaccess and add
RewriteEngine on
RewriteBase /codeigniter_project
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

But rememer Rewritebase should be everything between your domain and controller without trailing / e.g.:
http://loclahost/codeigniter_project/welcome/
3. (Additional step) Be sure your $config[‘index_page’] in codeigniter_project/applicaton/config/config.php is set to
$config[‘index_page’] = ‘’;