Items tagged: Php


By Greg Ferrell » April 25, 2011

Have you been promoting JavaScript? Did you even know that you could/should be? It just got easier to help if you are using ExpressionEngine.

At JSConf 2010, Chris Williams started a project called PromoteJS to help get bad JavaScript references off the web. You will know how important a cause this is if you have ever done a Google search for JavaScript documentation or help. The top results are deplorable. (NEVER use w3schools.)

Read Full Article...

By Greg Ferrell » February 27, 2011

For a personal project, I needed to convert numbers to letters and double letters when greater than 26. This is rather a simple thing in PHP using the chr function.

The short of it is that you divide by 26 and get the letter, then repeat the letter for every multiple of 26. This gives us our double letters accurately. I also added an option for uppercase.

Read Full Article...

By Greg Ferrell » December 19, 2010

I do a lot of testing with PHP that requires serialized data to be passed and retrieved. Many times this can be a pain to read, so i made a quick shell script that will take a normal input or if thats missing, get the clipboard from OS X and serialize it. This requires that you have the PHP CLI installed (default on OS X).

Then quite handily, you can just type php_unserialize in your terminal and it will spit out a var_dump of the unserialized data that you can read.

Read Full Article...

By Greg Ferrell » May 15, 2010

So, I finally decided to take the time to update my website to the ExpressionEngine 2.0 Beta.

This means that some of my stuff is going to be broken, but I can live with that. Going to improve how things are done and use better components this way. But the transition had a couple of small hiccups…

Read Full Article...

By Greg Ferrell » September 26, 2009

In many other interpreted programming languages like: Python, PHP, ActionScript 3.0, etc., you can have defaults to arguments that do not get passed to functions. In the three a fore mentioned languages, it's as easy as saying arg = 'default' inline in the function definition. This however is not available in the JavaScript interpreter. (It might be in ECMAScript 5, though.) But that can easily be remedied with a simple helper function.

I have met other programmers that find it ridiculous that you have to create features in JavaScript that are built into other languages. They use that to put down JavaScript and call it a terrible language. However, I think that's part of what makes JavaScript so great. JavaScript, though not as powerful in features as some other languages, offers enough flexibility and expressiveness that you can create what you feel that you are missing. Lets take a look at the problem and see how easy we can remedy it.

Read Full Article...