Archive for December, 2010

snowUI: Template to create a snowUI DAO

Monday, December 27th, 2010
var MockUserDao = (function(){

    var somePrivateStuff = null;

	// Object function
	function MockUserDao(){};

	// ------ DAO Interface ------ //
	MockUserDao.prototype.getUser = function(objType,id){
	  somePrivateFunction();
	  ....
	}

	....
	// ------ /DAO Interface ------ //

	// ------ Privates ------- //
	function somePrivateFunction(){
	....
	}
	// ------ Privates ------- //

	return MockUserDao;
})());

snow.dm.registerDao("user",new MockUserDao());

OSX: Managing multiple iPhoto Library

Tuesday, December 21st, 2010

Eclipse: Set default file encoding to UTF-8

Thursday, December 16th, 2010
  • Eclipse > Preferences (or Command , on OSX)
  • General > Workspace | Text File Encoding (switch to Other: UTF-8)
You can also do the same at the project level.

CSS3: Text inset

Monday, December 13th, 2010

My preferred way:

text-shadow: #333 0px -1px -1px;
or
.inset-text {
  font-size: 32px;
  color: #344251;
  text-shadow: 1px 1px 0px #bad3ed;
  font-weight: bold;
}

Source: http://stylizedweb.com/2009/10/22/how-to-create-inset-text-with-css3/

Or

h1.insetType {
  text-shadow: rgba(0,0,0,0.5) -1px 0, rgba(0,0,0,0.3) 0 -1px, rgba(255,255,255,0.5) 0 1px, rgba(0,0,0,0.3) -1px -2px;
}

Source: http://sixrevisions.com/css/how-to-create-inset-typography-with-css3/

Javascript: Split a string into characteres

Wednesday, December 1st, 2010
"test 2".match(/./g)

Will return:

["t", "e", "s", "t", " ","2"]