Aug 11, 2013

I hate Ghost Blogging Platform!

Posted Aug 11, 2013
Hate is such a strong word along with despise, abhor, resent, loathe.. okay I'm just writing synonyms here but the thing is, this is not a hate blog, it's just a response to a blog written by Nitin Khanna. I enjoyed reading the post because it gives a different perspective on the what's not to like in project Ghost.

For those who don't know yet, Ghost is an open source blogging platform started by John O'Nolan. The motive and vision are great. I was immediately hooked and got excited with the idea of a new blogging platform to address the issues of existing ones, plus it will be written in my current favorite framework: Node JS which is based on Javascript.

Upon reading John's idea of his new project, a question popped in my head: will he and his team really achieve the "Just a blogging platform" concept? This aims to focus mainly on publishing content, but at the same time, make it customizable. I don't want to fight the idea, but more of challenge it, because what I'm seeing is this will be a Wordpress-like platform that does everything, but hopefully better. Sure, it will start as "Just a blogging platform" but if it's really that customizable, then there's no stopping anyone from turning this into the next WCM or CMS built for modern times. Just like what happened to WP.

Do we really need another Wordpress like platform?

If you understand what Node JS is addressing, then YES we do need another blogging platforfm. In my experience in using Node JS, from very simple codes like this site mvergel.com to somewhat more complicated ones, like in Pesobility.com, I really enjoyed it. Coming from a Java background, it made me excited about web programming again. Simple codes, doing extra-ordinary stuff; much like Ruby on Rails but I don't know, it might be very subjective to say it, but I didn't enjoy RoR as much as I enjoyed programming in Node.

This is the reason why I found Ghost in the first place, because I was looking for a blogging platform / CMS based on Node JS. But since node is still relatively new, I found it difficult to find a pre-built open source systems that just work.

However, Ghost is not really advertising itself as another Wordpress like platform, but more of a blogging platform. It will probably also focus on workflows and workflow customization which is virtually non-existent in other platforms (well, at least natively). Even so, do we need another blogging platform? A new one wouldn't hurt. People arguably just choose between Blogger and Wordpress nowadays. Those who wants more elegance and professionalism would go for Wordpress, those who want more freedom and lesser cost would go for Blogger.

NodeJs, Yes! Really!

Nitin Khanna's point is that Node is not yet ready for prime time: problem with native hosting support, and usability issue for non-developers. I can't speak for the laymans, but as a developer I find it relatively easy to get Node JS up and running, to the point the it can be done in one command. The command can be wrapped in a shell script which an end user can just double click, wait a few minutes and see his/her system live on the internet.

There are already various free and paid hosts that support Node: See the list here. One of the great things about Node is its resource consumption because it doesn't require a huge ram to run, and start-up is also relatively fast. These were my main problem with Grails framework, a Java framework. The framework is great, but it's so bulky and consumes a lot of resource that even a simple application needs at least 512MB of RAM to run normally, and start-up is extremely slow. Node JS I think only needs 256MB to run smoothly. It's relatively easy and less costly to support Node compared to other frameworks, and it's happening right now; more and more hosts are supporting Node.

Nitin's point may still be right though as Node is still new and needs more time to mature. It's getting there, yes, but probably not yet prime time-ready. However, Ghost, when it's released, won't be a mature platform instantly anyway. It will also take time and probably years to be ready for prime time; just enough time for Node to also mature.

Wordpress is here to stay.. well, at least for a while.

Another Nitin's point is how O'Nolan allegedly stole from Wordpress and gave nothing back. Controversial statement which John O'Nolan couldn't resist but to reply in the comment section. It would be cool if he were to also comment in this blog, but I don't have anything controversial to say, haha!

From my perspective, O'Nolan is passionate about writing / blogging and would like to use a platform in which he could really enjoy doing it. I believe WordPress is ALMOST it but still not quite, and this "almost but not quite" feeling probably bothered him everyday; why isn't there a service or a system that he really wants to use? I can relate to this. This is the same reason why I created Pesobility.com; for my needs, and help others who have the same needs and wants as I do.

Ghost won't probably replace WP anytime soon. WordPress is a proven platform, whereas Ghost still needs to time to prove itself. And even in the far future, I would see the two, along with other blogging platforms, co-existing to give end users a choice.

Final Words

Many of us, especially software developers / designers, have ideas that pop-up in our head from time to time. Some are great, some are not so great, but only a few really go out their way to make their idea into reality. Not everyone has been given the chance to learn to type stuff and make the computer do something special.  It's almost a god-like skill because it is as if you are creating something out of nothing; the possibility is endless, imagination is your limit. Take advantage of it!

I admire what O'Nolan started. I'm excited to try Ghost now, but unfortunately the code is not yet available publicly. I do wish they release it soon! This part I don't get, why not just release the code immediately. I hate it! I hate Ghost Blogging Platform, haha!

A thought just came to mind.. I wonder if Google would think of upgrading Blogger to use Ghost. Far-fetched.


Jul 29, 2013

[Solved] Zurb Foundation and Google Custom Search Engine layout problem

Posted Jul 29, 2013
When adding a Google Custom Search box in your site that uses Zurb Foundation 4, it is most likely that the search button will be distorted and the search box won't have proper padding and you'll see various styling issues.

For a demo of a working zurb + custom search, just visit pesobility.com

The solution is to add this into your CSS:

.gsc-control-cse  * {
 -moz-box-sizing: content-box !important;
 -webkit-box-sizing: content-box !importantx;
 box-sizing:  content-box !important;
}

.gsc-control-cse input {
 box-shadow: none !important;
}

.gsc-control-cse input:focus {
    outline: none;
}

.gsc-control-cse table {
 border: none;
 background: transparent;
}

.gsc-input-box, .gsc-search-box .gsc-input>input, .gsc-input-box-hover {
 -moz-box-shadow: none !important;
 -webkit-box-shadow: none !important;
 box-shadow: none !important;
}

Jul 28, 2013

How to Add Responsive Google Ad Code

Posted Jul 28, 2013
Many asked before if it's legal to change the ad size through javascript, now it's official, Google allows modification of its ad sense code for responsive design.  You won't be breaking any terms and conditions when you do this.

Do note that the adsense javascript code below is not really responsive in a sense that when you resize the browser, the ads change size dynamically; no it doesn't do that. It only checks the window size at start and set the appropriate ad size. You have to refresh the page after resizing the browser to see the ad size change.

The code:
<script type="text/javascript">
    google_ad_client = "your publisher id"; //change
    width = document.documentElement.clientWidth;
    google_ad_slot = "111"; //change
    google_ad_width = 320;
    google_ad_height = 50;
        if (width > 500) {
        google_ad_slot = "111"; //change
        google_ad_width = 468;
        google_ad_height = 60;
    }
    if (width > 800) {
        google_ad_slot = "111"; //change
        google_ad_width = 728;
       google_ad_height = 90;
    }

</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

At least it's getting there, maybe soon we'll see a truly responsive ad.

Jul 16, 2013

XCode 4.2 and Phonegap / Cordova and CDVInvokedUrlCommand compile error [Solved]

Posted Jul 16, 2013
When you download Cordova / Phonegap and create an iOS project using the create command, the resulting project has many compile errors if you do not use XCode 4.5. It is also written in their documentation and at least XCode 4.5 is needed to run their project.

Those using Snow Leopard OS are stuck with XCode 4.2, so it would be helpful if phonegap / apache cordova runs in XCode 4.2.

The first error you will encounter is Automatic Reference Counting Issue of CDVInvokedUrlCommand for instance message does not declare a method with selector... on line 62 of CDVInvokedUrlCommand.m with the code: [self massageArguments];

Found out that the compatibility issue was just due to declarations, position of methods, and use of new syntax (The "at" syntax of new iOS @{} for NSDictionary). So I just changed the code to be compatible with older version of compiler / SDK and it worked! I was able to compile and run it in my simulator.



I uploaded the working sample project in github: https://github.com/mannyvergel/cordova-ios-xcode-4.2


Jul 4, 2013

XML nodes over 64K in size cannot be printed when using Binary XML Storage [Oracle] [Solved]

Posted Jul 4, 2013
If you're using Binary XML Storage and you used DBMS_XSLPROCESSOR's CLOB2FILE method to write to file, there is a chance that you'll encounter the 64K limit of nodes.

The workaround is to use another method to write XMLType to file: DBMS_XMLDOM's WRITETOFILE:

Declare your desired directory:

create or replace DIRECTORY XMLDIR AS 'C:\tmp';


Use dbms_xmldom to write XMLType column to file:

declare
  doc DBMS_XMLDOM.DOMDocument;
BEGIN
  for c in (select xml_col from xml_table x where key_col='mykey') loop
    doc := DBMS_XMLDOM.NewDomDocument(c.xml_col);
    DBMS_XMLDOM.WRITETOFILE(doc, 'XMLDIR/output.xml');
end loop;
/

Jun 19, 2013

Write XMLType Column to File using dbms_xslprocessor [Oracle] [Solved]

Posted Jun 19, 2013
Declare your desired directory:

create or replace DIRECTORY XMLDIR AS 'C:\tmp';

Use dbms_xslprocessor to write XMLType column to file:

BEGIN
  for cur in (select XML_COLUMN from YOUR_TABLE) loop
    dbms_xslprocessor.clob2file(cur.XML_COLUMN.getClobVal(), 'XMLDIR', 'NAME.xml');
  end loop;
END;
/

Clear Oracle DB Cache [Solved]

I used these 2 commands to clear cache in between queries in Oracle DB especially when testing for performance:

ALTER SYSTEM FLUSH BUFFER_CACHE;

ALTER SYSTEM FLUSH SHARED_POOL;