| Subcribe via RSS

Remap function for CodeIgniter

July 26th, 2009 | No Comments | Posted in Bin

I got tired of looking for this code in other projects so I wanted a handy place to keep it.

PHP:
  1. <?php
  2. function _remap($method)
  3. {
  4.     if (method_exists($this, $method)){
  5.         $this->$method($this->uri->segment(3));
  6.     } else {
  7.         $this->index($method);
  8.     }
  9. }
  10. ?>

In case you're wondering, this function is a reserved method in CodeIgniter controllers that will allow for a dynamic method name to be passed into the URL. Docs on it are here: codeigniter.com/user_guide/general/controllers.html#remapping.

Backwards Text in Gmail App

July 20th, 2009 | No Comments | Posted in Bin

backwards-gmail
I'm not sure exactly what happened here, but this is what I saw when I re-opened Chrome and my Gmail Tab that was left open got restored. Any ideas?

Why “hiding” source code is bad.

July 8th, 2009 | No Comments | Posted in Bin

I've been working at my current employer for about 5 months now and since I started, I have been involved in or heard this conversation more than 10 times, which is 10 times more than I've heard within the past 7 years I've been doing web development. The client wants their source code hidden from public view.

Let me first explain where I feel the communication has failed. The client says "Source code", however they may mean "Application code". To the client, when they "View Source", they may not know exactly what they are looking at, all they see is code. If they don't understand the difference between HTML code and Server side code (PHP/.NET/JSP), they feel like the code that makes their site work could be compromised. It is imperative that the client understand the difference between these 2 types of code and that their server side source code is safe.

More »