Picking up the breadcrumbs

Its always easy to skip going through the details of what your stacked up knowledge and just go for trying out new stuff. This time, I take it one step back and skim through pages of books I have always ignored and pick some sections that are worth looking into and post them here.

I've been trying to cut down on paper materials at home. Mostly, trying to read all those books and photocopied materials and just jot down notes from them. I decided to post them instead. See some string, number, time/date extensions.

Read the rest of this entry

Acknowledging the unknown as part of the process

I think this is by far the best, though vague and ambiguous poetry I've ever seen and I loved it!

Makes me want to keep in mind that knowledge in programming is quite volatile as it comes to real world problems to be solved, and that no accurate solution is definite across a period of time. The unknown is really a part of the process.

Read the rest of this entry

The power of toggle

I don't know if we've been missing out on deliberate API lovin' or that we're becoming dumber every minute because of too much work, or its just the love month? tongue ...but we've been missing the power of "toggle".

Toggle is [defined][1] as:

any instruction that works first one way and then the other; it turns something on the first time it is used and then turns it off the next time

Needless to say, toggle is very efficient for use with boolean values (defined by either true or false). Of course you might think its easy to implement, but this is an explicit example to illustrate on saving database reads and writes. Aside from that, you'll write a more elegant code. wink

Read the rest of this entry

DIY Ruby SFTP to S3

I was faced by a challenge of transferring some files from an FTP server to S3. At first, the nature of the problem seemed simple. I just had to get the files to my local machine and then upload them to S3. Piece of cake! But lo and behold, when I saw that there were over 32K files and each step took me almost 2 minutes each! Oooh lala!

I knew this was a job for fanfare sound here the almighty ruby! smile

And so, I set my priorities straight.. I had to work elegantly and save time altogether. I'm feeling quite exhausted and would really love to get some sleep soon, so here I am, depending on my great yet simple ruby skills and the power of ruby itself to help me achieve this task!

As I write this article, my script is silently running in the background as a very obedient and competent slave. tongue But to help you out, here is a brief guide on how to sit back, relax and let the task be accomplished in no time! You should really be sending me gifts.. or better yet, donate to me via Paypal! I'll love it, I promise.. I might even give you a page of exposure! :)

Read the rest of this entry

Forcing urls to use https

If you have the need to force certain pages of your site to use ssl, but its becoming extremely cumbersome to find out the links that point to that page, this is a better approach, which seems to be more adhering to SPOT or (single point of truth).

Just add one method to your application controller and call before_filters to your specific controllers. That's it!

Read the rest of this entry

Wordpress 2.8.4 release, a joke?

I have been maintaining several Wordpress blogs (all currently running 2.8.3 as of the time of writing). I logged in earlier today, and found that there was a new release. Of course, I wanted to have them all updated at the soonest possible time.

By practice, I download the zipped file to apply them manually onto our source code repositories for update. Usually, I find this useful because I get to see what the changes really were for the new release. I was surprised to see that the new version I downloaded was a complete joke.

I got Wordpress 2.8.4 here. I downloaded the file also inside the server, for a quick copy of the latest version, in case it will be needed. Applying it to local copy of the repository, I found some big joke. Amusing, but also confusing.

Read the rest of this entry

Free mini store search app in PHP and AJAX - for dummies

This is a very crude and very simple application which was for a demo purpose as requested by the client. I haven't been using PHP and (moreso) AJAX in over a year and a half already. This task was really more of a fun challenge that I cannot resist. I just wanted to see how long I can work on this and deliver what the client's requests were. Funny that this simple task was quoted to take 14 days of dev work, while it took me less than 5hours (since I was able to work on a CMS from scratch along with this all in 5hours of work time).

If you find yourself in need of a jumpstart, consider this the best freebie for you. Enjoy, and next time, give the client the correct estimates. It might save you both from hating each other and ruining possible future projects. wink

Read the rest of this entry

Premium should be quality

Aside from daily tinkering of Ruby on Rails application, both for work and play, I have to serve requests that involve other scripting languages such as PHP and Python. PHP is the least of my favorites, but since its still the most widely used scripting language, in which more and more non CS grads have been so boastful of knowing, then I still go ways to cater to such applications. Love of Python is another thing. Its as beautiful as Ruby is for me, and as strict as how I tend to live my life. wink

As of the moment, I have a project running in PHP which was built using Smarty, though is not yet deployed on client's public server. Aside from this, I am also happily supporting several Wordpress powered blogs. I don't choose the themes, but I do have an input on whether its a good choice or not. We have completed customization of two of these blogs and was working on the last one yesterday. The chosen theme was IndoMagz2. Of course, I immediately uploaded the theme for use. After that was the anticipation of other stuff to be removed or added.

I couldn't have reacted negatively if I didn't have to go through the codes themselves to make some tweeks. At first glance, it looked just like any other magazine type wordpress theme. Blocks of elements are organized in the left and right columns of the layout. Although, I quite believe that three columned layouts are far better in information exposure, I don't have anything against using two columned layouts. I even thought that the layout was neat looking and the default banner would have really suited the new blog we were fixing. It was called "Ugaling Pinoy" which translates to "Filipino Attitudes" or even "Filipino Characteristics".

Read the rest of this entry

Be wrong to be correct

alt text

Making GTD work for you using Hiveminder, Google Calendar, iCal, iSync and your mobile

insert main hiveminder image here

I'm a fairly new member of Hiveminder. I remember, I saw it first from a Lifehacker article discussing about the best GTD tool. I wanted something unobstrusive and could be used in a variety of ways.

I found Hiveminder and I gave it a spin. I immediately liked its simple layout which is quite refreshing and neat. I don't have to think much about how to use it. I immediately began using the "braindump" for all the tasks I had to work on. Though I'm a fan of handy notebooks, I would very much love to have technology remind me of things I need to work on too. Sometimes, I get too lazy to read my notebook or scribble down my thoughts for most of the time, I think faster than I could write!

Read the rest of this entry

Playing it safe with Google's web tools

Just for the sake of 'doing-it-right', I enrolled all my sites into Google's Analytics and subjected them to Google Webmaster's tools. I'd check them from time to time to set some updates and fix reported errors.

Google Webmaster's tools is quite a handy measure for beginners who don't know where to start with their site monitoring or how to improve their pages the way Google sees it. You can optimize your page titles, see how to do it..

Read the rest of this entry

Migrate to your Wordpress blog using Ruby and Atom

Recently, I have encountered a dilemma regarding my personal blog. I have it hosted by a local blog host provider. It was great staying there and blogging there when there was still this very tight-knit community of bloggers. From time to time, we'd all meet up and just express our thoughts in person. The providers were really great with hearing out their users' thoughts, wishes including rants and raves. They were really good with what they were doing (up to some point in time).

...

Now, being the Ruby lover that I am, I decided to write a Ruby script that would scrape my content and push it onto my new Wordpress blog. There are a couple of assumptions/caveats for this script:

  • You can scrape off content from only YOUR OWN BLOG. Please don't use this to steal other people's content. I am not liable for any online content theft from the use of this script.
  • You must be able to understand the structure of the blog you are scraping. You should know where the "excerpt", "main body", "post date", "post author", etc. info are located from the markup/source of the blog you are scraping.
  • You must have the credentials of the blog where you want to push the scraped content.
  • If in case you need something else, or some more tweaking to this script, you must know Ruby, or maybe you can drop me a line and I'll see how I can help you.
  • This script uses Atom tools, although there are other gems available, this is what I chose to use.
  • Turn on Atom publishing in your Wordpress blog.

...

Read the rest of this entry

Code revisiting and housekeeping

Its a great success for every programmer once a project or an assignment has been completed. But give it a day, a week or even a month and the good old code in place is now stale.

Its every programmer's duty to revisit their codes once in awhile and reassess if the old codes are still pretty much the best codes to be inplace or if there's something new that could do something better, faster and easier with much less effort than before.

Read the rest of this entry

Easy CSS rounded corners

Rounded corners are easily achievable. Either via CSS or Javascript. See this sample using CSS, or the resource in Javascript. Read the rest of this entry

Category: Design and CSS Tags: , 0 Comments »

Removing "out of sync" error in acts_as_solr

It could've been pretty straightforward removing this concerned item from the solr index and then everything would be well.. but its a lot harder than that if you're looking at over a thousand indexed elements vs their 'existing' counterparts in the database! Finding the exact data to remove was really the hardest part! I never knew this until I took the liberty of helping out our kind Infra Team to resolve the problem. I decided to tweak the solr parser method returning the "out of sync" error. I thought that it would actually be brilliant to just display the concerned element's id so that they could delete it from the index itself. And so, I had something like this: (in acts_as_solr/lib/parser_methods.rb) Read the rest of this entry

Hi, I've been busy you know. wink If you don't know yet, this site and my blog codes are hosted in . I recently moved to Git and found that they have support for private Git repositories. Below are details of my last git push.

Maricris S. Nonato on 26 Mar
Commit: e734bd6878629223c5067326471d7ec0aac7d6e4

Updated display of ads and popular content