Translate

Thursday, June 19, 2014

SASS and Compass

You may have heard the terms Sass or Compass being thrown around recently. Or perhaps you haven't. But regardless of if you've heard about it or not, Sass is something that any Front End Web Developer should have tucked in their tool belt. Basically, Sass is a simpler way of writing CSS. You might ask yourself: "Why would I want to write Sass when I am already proficient in CSS?". Well the answer to that varies depending on who you are.

For me, the feature that really draws me into Sass is cross-browser support. Have you ever wanted to use, for example, a linear gradient, but end up having to find a gradient generator, or check CanIUse(caniuse.com) or similar sites so that you know which vendor prefixes to use? That might be fun and exciting the first dozen or so times, but eventually it gets a bit old. One nice thing about Sass is that you can just type:

.some-class {
  @include background(linear-gradient(top left, #fff, #eee 50%, #000 100%));
}

into your CSS, and it will automagically spit out:

.some-class {
  background: -webkit-gradient(linear, 0% 0%, 100% 100%, color-stop(0%, #ffffff), color-stop(50%, #eeeeee), color-stop(100%, #000000));
  background: -webkit-linear-gradient(top left, #ffffff, #eeeeee 50%, #000000 100%);
  background: -moz-linear-gradient(top left, #ffffff, #eeeeee 50%, #000000 100%);
  background: -o-linear-gradient(top left, #ffffff, #eeeeee 50%, #000000 100%);
  background: linear-gradient(top left, #ffffff, #eeeeee 50%, #000000 100%);
}

There is a bit more to it than that, as you need to get Compass, which is basically the Sass compiler and then compile your Sass. But it really is a pleasurable workflow once you have it all set up.

Some other things that Sass can do is have variables, so you don't have to jump into Photoshop and grab your logo's color every single time you want to use it in your stylesheet, resulting in tons of different colors being declared throughout the file. Sass also greatly simplifies nesting. For example:

#someId {
  @include transition(all 0.3s ease);
  .someClass {
     .someDeeperClass {
       @include background-clip(rect(0px,50px,200px,0px));
       @include rotate(-25deg);
     }
  }
}

Would result in:

#someId {
  -webkit-transition: all 0.3s ease;
  -moz-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
}
#someId .someClass .someDeeperClass {
  -webkit-background-clip: rect(0px, 50px, 200px, 0px);
  -moz-background-clip: rect(0px, 50px, 200px, 0px);
  background-clip: rect(0px, 50px, 200px, 0px);
  -webkit-transform: rotate(-25deg);
  -moz-transform: rotate(-25deg);
  -ms-transform: rotate(-25deg);
  -o-transform: rotate(-25deg);
  transform: rotate(-25deg);
}

It really is very simple once you have messed around with it for an hour or so, and the code that comes out of it feels refreshingly clean!

If any of this Sass stuff sounds like fun, I suggest checking out the following article by Adam Stacoviak on The Sass Way, and checking out Chris Coyier's Screencast on the topic.

Friday, June 6, 2014

Learning Resources

Hello again, everybody! It's been a while, but I hope this post will make up for the hiatus. Work has been busy, and the Summer semester just started back up after a one-week break. I've been around, though!

I felt that it would be beneficial to everyone if I could share some resources for developers like myself. I've begun collecting quite a few resources which I feel would be useful to folks who are trying to keep current in this fast-moving profession that we have found ourselves attracted to.

They will be organized into categories, and I will have the free services up top, and the paid ones down below the free ones. I will move this to its own page soon and keep it updated there to the best of my ability. Enjoy! Let me know if you have anything that should be added to this list.


Interactive Learning

This is the classic that has to be on here. I personally got started here with the basic JavaScript and PHP tutorials. It is a bit limited in it's selection, however, it is a very valuable resource for new programmers, or those who are interested in a new language.

This is a wonderful site for learning Node JS. I haven't made it very far in, however, I really like the way it is presented, and definitely recommend it. You can download a lesson, and it will be added to your Path, so you can play it using your command line. Also provides lessons for Functional JavaScript programming, and Git basics.

This is a fancy little site where one can learn or polish their Python skills in exercises set in a virtual world. You can compete with others, and categorize your solutions so that others can check them out. The sign-up includes a brief JavaScript -> Python comparison for those who are proficient in JavaScript but do not know Python. I believe they plan to add more comparison guides in the future.

Learn SQL with short interactive lessons. A concept will be explained, then shown to you, and then you will be asked to modify the pre-written statement to retrieve a different result. Simple, yet good if you need to brush up on your SQL.

Learn general programming ideas and constructs through an interactive game. I have not proceeded far in this game, nor have I tried the multiplayer, so I do not have much else to say. Give it a shot!

Link Hubs

A Samuel L. Jackson inspired hub of links relating to programming. From Languages, to Frameworks, to Tools, to language-agnostic information about programming, this sure if a motherload of good links. 

Another excellent link hub with sites that will dive into programming languages. This is a great one. Has information on many topics from the entire stack. 

Teach Yourself To Code
This is a great site which links to several sources on how to program in specific languages or frameworks. Some of these are paid, however, the paid ones are denoted by a dollar sign.

This GitHub repo holds links to tons of RSS and Podcast feeds which are targeted towards Front-end developers. Worth a good check-out. I follow quite a few of these with my RSS and Podcast aggregators.

A collection of free books which explore various programming topics. I haven't extensively looked into this one, but it seems like a valuable resource.

This is another one which is hosted on GitHub. Quite a few books are on here. Once, again, this is getting into territory that I simply haven't had time to extensively test, however, I am sure that these books are wonderful.

This is a wonderful site which is dedicated to teaching you to code 'the hard way'. It's not really that hard. In fact, it guides you just enough while making you do the exercises. Definitely check it out. The books are paid books, but there is a free alternative if you do not wish to purchase the books.

Not so much specifically about programming (there are quite a few useful programming links), but a good resource nonetheless. 

Weekly E-mail Newsletters
To say that this is just a JavaScript publication would be severely understating it. There are also Ruby, Postgres, Bitcoin, and more! Right to your inbox each week.

Very similar to JavaScript Weekly, but curated by different folks. Also worth a subscription!

Useful Tools

Legal licenses dumbed down so they can easily be understood. I still recommend reading the licenses, but this is a good start if you are not fluent in Legalese.

This is a good resource for free icons. 

Interesting Articles

A very true and satirical look at programming. Well worth the read.


Good Paid Services

I had the pleasure of checking this site out a while back and loved it a lot. They have a ton of video content. I consider this one to be well worth a check out. They offer a free trial before you buy if you are unsure about the content.

A well known video site where one can learn anything from Photoshop to PHP. Check this one out if you have a few bucks to drop for a subscription. 

This is another video site in a similar vein to Pluralsight and Lynda, however, this one has interactive sections between videos, which I found to really help in hammering the knowledge into your memory.