My First Post      My Facebook Profile      My MeOnShow Profile      W3LC Facebook Page      Learners Consortium Group      Job Portal      Shopping @Yeyhi.com









Saturday, January 12, 2019

Stylesheet Types : CSS, SaSS, SCSS - What do they mean

Ever wondered what is the difference between SCSS and Sass. More importantly, how are they different from CSS.

To start with let me point out that Sass is a language or a pre-processor that makes CSS more powerful with variable and math support. It provides syntax advancements. Style sheets in the advanced syntax are processed by the program, and turned into regular CSS style sheets. However, they do not extend the CSS standard itself. You can do operations like additions and introduce variables in CSS using Sass.


The SCSS is also called Sassy CSS. This is an extension of the syntax of CSS. This means that every valid CSS stylesheet is a valid SCSS file. Files using this syntax have the .scss extension.


The Saas format described earlier is also known as the indented syntax. It provides a more concise way of writing CSS. It uses indentation rather than brackets to indicate nesting of selectors, and newlines rather than semicolons to separate properties. Files using this syntax have the .sass extension. However, as already told that all this works only with the Sass pre-compiler. In the end what is created is simple CSS. It is not an extension to the CSS standard itself.



The Sass .sass file is visually different from .scss file, e.g.

Example.sass - sass is the older syntax

$color: red

=my-border($color)
  border: 1px solid $color

body
  background: $color
  +my-border(green)

Example.scss - sassy css is the new syntax as of Sass 3

$color: red;

@mixin my-border($color) {
  border: 1px solid $color;
}

body {
  background: $color;
  @include my-border(green);
}
Any valid CSS document can be converted to Sassy CSS (SCSS) simply by changing the extension from .css to .scss.

Thursday, January 3, 2019

Packing and unpacking tar/gzip files on Windows


A few years ago I wrote a similar blog for Linux. Refer https://www.w3lc.com/2011/06/tar-command-in-linux-to-archive-and.html. However, the question is again very relevant if your OS is Windows and its family. Hence this post.


Method 1: Using compression utility

First you compress it to tar with 7-zip and then to gzip with 7-zip.
You u can do using their UI or command line support provided by them.

Following is the example if you want to use 7z tool or its dll:

  • Create .tar.gz: 7z a -ttar -so dwt.tar dwt/ | 7z a -si dwt.tar.gz
  • Extract .tar.gz: 7z x dwt.tar.gz -so | 7z x -si -ttar



Method 2: Using bash shell on Windows like UnixUtils or any other Bash of Ubutu etc on Windows.

If installed, make a directory and proceed as follows:
cd /mnt/c/[path to folder to archive]
tar -pczf archive.tar.gz *
In fact, if you notice this approach is similar to my earlier blog for Windows.


Method 3: Write your own subroutine/function to generate a Zip file.

Yeah! you can do it. Thousands of companies do it. And you can find open source solutions as well. Because these formats are in any case open source! Pretty easy :)


Method 4: Extending method 1 more, you can use Gzip for Windows - GnuWin32. This utility has command line version as fell. Refer http://gnuwin32.sourceforge.net/packages/gzip.htm