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

Extending Database_form to send Emails via Mailer extension

Radiant is just a gem. Its installation is very easy, and super fast. I really didn't have much trouble. But the thing is, I wanted to have more control over the code itself, since I will be tweaking the Radiant app into something that fits their needs, and my deliverables too. And so, if you end up with this decision, just unpack your radiant gem.

gem unpack radiant

Once you have the tree generated, you'll see that its a normal Rails application hiding in the gem. Now you can inspect the code, and have it tweaked according to your will. I made changes in some of the templates, stylesheets, etc, and added some extensions. One of the uses of the site would be to serve as a mail form where users can contact them via a feedback section. I checked out their [Third Party extensions][8] which was quite extensive enough. I found a couple of them that I really needed:

Read the rest of this entry

Sorting is a part of Searching

Anybody who has used the net for research or part of everyday work knows how to search. Searching is one of the key aspects of using the internet. With so many information out there, you might never find what it is exactly you're looking for if you don't know how to search. ..Not all sites that offer searching offers sorting. Isn't a wonder?.. Read the rest of this entry

Caution: Programming is addictive

True that its symptoms of pain gradually increases over time. I'm a touch typist and I usually feel the pain when typing things for long straight hours without a break. (just like when I blog or when I program). The pain now lasts longer and disappears only for a short while. It has gotten into my attention lately, and so I tried to work on a short term remedy. I bought myself a wrist brace. Although Occupational Safety and Health Administration (OSHA) states that CTS is not directly proven to be caused by repetitive activities as compared to structural and biological risk factors, I still cannot take away the fact that the pain emanates during contact with the computer. *Below are photos of my wrist brace*.

Read the rest of this entry

Testing is a Remarkable thing!

I never knew testing could really change the way I code. I know I’m a good programmer because I love implementing standards and doing the “right things” the “first time”.. and yet testing has made me realize something..

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 16 Jan
Commit: aa7640e30ade7a41faa4d42dab73af281817ff64

Removing ratified and updating me imageRemoving ratified and updating me image
  • 60 day SNS abstinence 2010-02-08
  • is it just me or multiply just keeps choking all the time ?? 2010-02-07
  • LivingLife :: Follow Me: I heard this song yesterday in the one place I hate the most. Must be a long long tim... http://bit.ly/agCNpt.. #fb 2010-02-07
  • the end justifies the means. that's how i feel right now 2010-02-06
  • don't ask how i am. apparently i'm still alive 2010-02-06
  • knock knock. D&L go away.. 2010-02-06
  • working more than two projects at the same time at the same place is draining me!!! 2010-02-05
  • i can't wait for Feb 12!!!!! 2010-02-04
  • get off the net (?) ..but i can't! sad sheezz 2010-02-04
  • i'm taking a round-robin trip around so many emotions in just a day! hopefully i end up with the best one. #fb 2010-02-04
  • @AdeMagnaye damn you're right! tongue 2010-02-03
  • is having some elevator blues.. i need a cone of silence. *bows and screams* 2010-02-03
  • @techpinas go Pidgin! wink 2010-02-03
  • men are like networks, or servers. i have my reasons LOL. 2010-02-03
  • I am sooo.. going to get this: http://bit.ly/8YDaLP.. soon smile 2010-02-01
  • ..on Do Not Disturb mode. Busy counting smiles smile 2010-02-01