Boinx's Blog

Stepping stone

New Things!

Compass and SASS

Recently, I learned how to use Compass and SASS. It is a great help for all the web developers out there. It gives them ease on doing or editing the CSS of their projects. It allows you to create mixins, makes it easy creating sprites, generates your CSS file fast, allows you to import css file to another css file so you’ll just have to link 1 CSS file to your project. For a beginner like me, yes it benefits me a lot.

Compass is an open source application that uses SASS(Syntactically Awesome Style Sheets). SASS is an extension of CSS3 that allows you to nest rules, add variables, create mixins and etc. It is also the one who generates your CSS.

Examples of SASS Commands:

Nested Rules

#content{
    background-color:black;

    .box{
        background-color:black;
    }   

}

When compiled to CSS, it will look like this:

#content{
background-color:black;
}
#content .box{
background-color:black;
}

Variables

$black = #00000;
$w = white; 

Now you can use these variables anywhere on your project just don’t forget to import it to the CSS file where you need to use it. You can simply type, @import ‘name of the scss file’;. You can use the variables like this:

background-color:$black;
color:$w;

Mixins

@mixin myFont{
font:{
    family:Arial;
    size:15px;
    weight:bold;
}
}

You can use it by using the @include method.

#pageHead{
width:500px;
text-align:center;
@include myFont;
}

That’s all for now. I’ll update this blog again as soon as I learned something new! Thanks for reading! :)

Fresh From Vacation

Python and Javascript

Python and Javascript are the two programming languages that I’ve learned during the Christmas Vacation. For me, Python is more confusing than Javascript because you don’t end your statements with semicolon and it doesn’t need to have curly braces in making functions and if/else statements. It relies on white spaces and indentions(which can be a little bit tricky when you’ve lost track of the indentions).

Example: IF/Else Statement in Javascript

    if(5>2){
    console.log("Yes");
    }else{
    console.log("No");
    }

IF/Else Statement in Python

    if 5 > 2:
        print "Yes"
    else:
        print "No"

The output of both the if/else statements is the same. We can see that in Python, we didn’t have to use open and close parentheses, curly braces and semi colons. However, it is more confusing than Javascript because if we’ve made a mistake on our indentions or spaces even just one white space or one tab space your program will end up having an error message. Now, I will show you how to declare variables on Python and Javascript.

Example: Declaring Variables in JavaScript

    var a = 5;
    var b =10;
    var c = a*b;

Declaring Variables in Python

    a = 5
    b = 10
    c = a*b

As you can see, Python doesn’t require you to put var when declaring variables while on JavaScript in order to declare a variable you need to specify that you’re declaring a variable by following this method: var variable_name = value. They can both also get input/s from the user without needing a form in html. We can do this by using the prompt for JavaScript and raw_input for Python.

Example: Getting input/s from user using JavaScript

var a = prompt("What is your age?");

Getting input/s from user using Python

a = raw_input("What is your age?")

That’s how you get input/s from a user using JavaScript and Python. Now, I’ll show you how to create functions using JavaScript and Python.

Example: Defining functions in Javascript:

function Boinx(args1,args2){
    return args1*args2
});

Defining functions in Python:

def Boinx(args1,args2):
    return args1*args2

That’s all for today. I just shared to you the basics in JavaScript and Python. It will take a lot of time if I’ll discuss everything I’ve learned from studying the two languages. I’ll study more languages and update this blog as soon as I’m finished.

First Blog

Leap of Faith

Hi, I am Tony Bantug but you can call me “Boinx”. I am currently a 4th year college student taking up BSIT at College of the Immaculate Conception. I am having my Intership at a company called “Favorite Medium”. By the time this opportunity was offered to us, I had second thoughts on grabbing it because I thought that this was not my field, doing websites because I am not artistic enough and creative enough. But then my eagerness to learn more and my willingness to get out of my comfort zone pushed me to grab this rare opportunity. So I took it. I have no regrets since then, I’ve learned a lot that I didn’t learn from school. Learned and currently learning new Programming Languages. I’ll do my best to contribute to this company and not to waste this wonderful opportunity given to me.