Skip to content

Instantly share code, notes, and snippets.

@kopiro
Created November 26, 2011 14:58
Show Gist options
  • Save kopiro/1395811 to your computer and use it in GitHub Desktop.
Save kopiro/1395811 to your computer and use it in GitHub Desktop.
My PortFolio
/*
Flavio De Stefano Portfolio (written in JS).
You can use these functions directly from the
javascript console built-in in any WebKit based browser,
or if you use Firefox in Firebug,
or if you prefer directly by prefixing
the 'javascript:' protocol in the address bar.
*/
var Flavio = function () {
this.firstName = "Flavio";
this.surName = "De Stefano";
this.bornDate = new Date("October 30, 1991 01:00:00");
this.eMail = "[email protected]";
this.fbUser = "destefano.flavio";
this.webSite = "http://kopiro.it";
this.skills =
{
"Developer" : ["C", "C++", "JS", "PHP", "Qt/C++", ".NET"],
"Designer" : ["Adobe Photoshop CS5", "HTML5 Markup"]
};
this.employers =
[
{
name : "Pane & Design",
from : "September 1, 2011",
to : "",
sector : "Web Developer",
projects : ["ViviAteneo.it", "Pane&Design.com", "Oppure.me"]
}
];
// Set the current object
var self = this;
this.getName = function ()
{
return self.firstName + " " + self.surName;
};
this.getAge = function ()
{
var msDiff = new Date() - self.bornDate;
return Math.floor( msDiff/(1000*60*60*24*365) );
};
this.getEmail = function ()
{
return self.eMail;
};
this.visitWebSite = function ()
{
window.location.replace( self.webSite );
};
// Some browsers block this popups, so fix it.
this.viewProfilePicture = function ()
{
window.open("http://graph.facebook.com/" + self.fbUser + "/picture?type=large");
};
this.sendMeAnEmail = function ()
{
window.location.replace("mailto:" + self.eMail);
};
this.getSkills = function ()
{
var returnValue = '';
for ( var key in self.skills )
{
returnValue += key;
returnValue += " (" + self.skills[key].join(", ") + ")" + "\n";
}
return returnValue;
};
this.getCurrentEmployer = function ()
{
for ( var key in self.employers )
{
if ( !self.employers[key].to )
{
var returnValue = '';
var currentEmployer = self.employers[key];
returnValue += currentEmployer.sector + " at ";
returnValue += currentEmployer.name;
returnValue += " ( from ";
returnValue += new Date(currentEmployer.from).toDateString();
returnValue += " )" + "\n";
returnValue += "Projects: " + currentEmployer.projects.join(", ");
return returnValue;
}
}
};
// Return the reference to this object
return this;
};
// Use this variable (me) to call the foos.
var me = new Flavio();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment