Ruby interaction with command line

Ruby have a way to execute command line program using back tick. Enclosed our statement to be executed by command line using back tick.

Lets try using back tick on irb !

we can put the output to a variable to process it like sample below.

ls is a command to list content of your file system, if you wonder …

bye and good night …

Alternative Syntax of Ruby Hashes

Hashes variant 1

cars = { “car1” => “avanza”, “car2” => “innova”, “car3” => “mirage” }

Hashes variant 2

cars = {  :car1 => “avanza”,  :car2 => “innova”,  :car3 => “mirage” }

Hashes variant 3

cars = {  car1: “avanza”,  car2: “innova”,  car3: “mirage” }

 

These are as far as i know.

HTML tables to elegant data tables !

If you want to make your regular html show better on browser you can use a javascript library from datatables.net.

simple example which i use on my project.

1. Add jquery >=1.7 and datatables js and css to your html page.

2. create a html table (use thead tbody tags) and give it an ID.

3. call javascript code as simple as below (can add option as parameter also).

$(document).ready(function() {
    $('#table1').DataTable();
} );
4. Enjoy your new good looking html table !
Below is latest datatables js and css as per today downloaded from datatables.net

Showing Manjaro Version

Manjaro’s rolling release mean that we can update our system every time there is a new version. Today i have updated manjaro on my laptop and its downloading 1.3 GB files in total.

After that i want to know what is the version of my manjaro but i cant find it on xfce GUI. After search on internet we can view manjaro version from a file on /etc.

Below.