Category

code

c

Localhost setup in Python

The Problem: setting up a local server could be time taking and there’s a heck lot of ways to do it, but when it comes to make a simple ajax query call or making image calls in the HTML5 canvas; it will need a localhost server! i’m sure you must be thinking “ah that’s not a problem allow me install 100+ mb softwares like mamp, wamp” or some might even start writing...

Opening Sublime Text via Terminal in mac

i don’t like running gulp commands from terminal and go to the docked sublime icon all the way to open sublime and then adding up a folder to work in that particular directory. here’s a short little tutorial which could help you open sublime text from the mighty terminal! 

Implementing a class in JavaScript

let’s implement a class called FeedDog in JavaScript, that has an object inside which changes when a function is called!
var FeedDog=function(treat){var obj={treatSize:treat};
obj.increaseTreat=function(){
obj.treatSize++;
};
return obj;
}

Ajax call request in jquery

Making an ajax call using jquery is pretty simple, let’s create an ajax request that updates a specified contents every 20 seconds!
$.ajax({
url : 'YOUR URL WOULD GO HERE',
type : 'GET',
data : {
'parameter' : 10
},
dataType:'json',
success : function(data) {
console.log('Data: '+data);
},
error : function(request,error)
{
console.log("Request: "+JSON.stringify(request));
}
});

JavaScript Time events

Time is one important aspects in interaction design, animations, sliders, tabs, event loaders, etc. are depended on timer for proper functioning. JavaScript provides two amazing timing event api’s the first one is : SetTimeout(); //following is the code for calling this little sweet function window.setTimeout(function, milliseconds); //it takes a function and millisecond as the second...

Animating The smiley

In my later post, i showed how to build a smiley using css3’s border-radius property. now let’s animate this cute little smiley 🙂

Going Object with JavaScript

We have all been there, those random written variables and function that are good enough to do one simple task, but breaks often when used for more than one tasks, reason? well, it’s because the code is meant for just one purpose, this is where object oriented programing comes in to rescue.

Latest from Sarabpreet