Wednesday, 31 July 2013

Amazing HTML5 Canvas - A map of Stars near Earth

A colleague of mine, my Master of OCM - Gareth Fox, was brushing up his Canvas skills and developed a map of stars within 15 light-years of Earth.




So much to learn so little I know...

Tuesday, 30 July 2013

Setting up Sublime Text 2 for Velocity (HTML) + BracketHighlighter

Sublime Text 2


1) Download Sublime Text.
2) Go to "Preferences" --> "Browse Packages..."
3) Create a new file called "Velocity (HTML).sublime-settings" with this content:
{    
    "extensions":
    [
        "vm",
        "tpl"
    ]
}
4) Do "Ctrl + Shift + P"
5) Type in "SS Velo" and select "Set Syntax: Velocity (HTML)"

Viola! Sublime text can recognise velocity (vm) files.


BracketHighlighter


1) Download the BracketHighlighter Zip from Github
2) Go to "Preferences" --> "Browse Packages..."
3) Unzip BracketHighlighter to the Sublime Packages folder.
4) Rename the file to "BracketHighlighter"

Viola! You have highlighting for open and close quotes.

Monday, 29 July 2013

Ruby Warrior!

https://www.bloc.io/ruby-warrior#/

A TRIUMPHANT QUEST OF ADVENTURE, LOVE & DESTINY
ALL WITHIN A FEW LINES OF RUBY CODE



Tuesday, 16 July 2013

Edit read-only filesystem in Linux recovery mode

1. Choose recovery mode
2. Manually recovery
3. In the command prompt, use the following command to change the read-only filesystem to be writable:
mount -o remount,rw /

Wednesday, 10 July 2013

Steps to get IntelliJ working with Liferay portal services

Assumption - Liferay has already been run before with tomcat and everything all set up. Uses Liferay Maven to manage projects.


  1. Download and install IntelliJ (The latest version as of writing is IntelliJ IDEA 12.1.4)
  2. Create a new project and point the project root to the SVN parent folder
  3. In Module settings, type in the name of one of the folder in the SVN parent folder
  4. For existing svn checked-out folders, use 'Import Module...' to add more folder to the IntelliJ project
    1. Use Maven model to import
    2. Tick "Keep project files in" checkbox
  5. For the ones without a proper package, create a new module with the same name and do a 'Import Module...'
  6. For the ones that haven't been check-out from svn, use built-in subversion to check out the folder to a destination folder and 'Import Module'
  7. Select all the modules and do Subversion -> Update Directories
  8. Top left -> Project -> Package - if packages exist here, it means it has been imported to IntelliJ successfully (Automatically import Library Dependencies)


To test that it work:

  • Create a new "workspace" folder - Utilities
  • Create a new file - test.groovy
  • Type "GroupLocalService" and you should have liferay portal services for selection
  • Once selected, it should automatically import the relevant liferay service into the file
  • Do this
    GroupLocalService groupService = GroupLocalServiceUtil.getService();
    groupService.
    Note that the "." at the end is requried
  • and it should have a list of avaiable API for this service.



Thursday, 4 July 2013

Test HTML email format

HTML email renders differently in various email client.

The most annoying of all is Microsoft Outlook 2007 and 2010 (could be more, but cbb to list them all). Why? They bloody use MS Word as their rendering engine!

Anyway, to test the format, try this site:
Puts Mail - http://putsmail.com

Put in your email address
Fix up the subject (optional)
Copy and paste your HTML code
Fire away to your mailbox!

Use the target email client to open up the mail to see the result of the HTML rendering.

Cheers