mrkeck Sharing the Love


PHP use / not \

When referencing folders use / instead of \
/ doesn't have to be escaped and works perfectly.

Filed under: Convention, PHP No Comments

Excel Combine Multiple Columns into One

'Put all data from B1-Z1000 into column A
Dim maxRow As Integer
Dim maxCol As Integer
Dim cnt As Integer
maxRow = 999 'Controls how many rows
maxCol = 25 'Controls how many columns
cnt = 0
Range("A1").Select 'Where to start putting data
For j = 1 To maxCol
    For i = 0 To maxRow
       If ActiveCell.Offset(i, j).Value <> "" Then
            ActiveCell.Offset(cnt, 0).Value = ActiveCell.Offset(i, j).Value
            'Remove original data
            ActiveCell.Offset(i, j).Value = ""
            'Get ready for next one
            cnt = cnt + 1
       End If
    Next i
Next j
Filed under: Excel No Comments

Youtube Like IDs

Shorter IDs = Shorter URLs =>

Light-weight PHP class that converts an integer into alphanumeric and vice versa

One-to-one conversion with no collisions, no database, and no dependencies


	include ('weeId.class.php');
	$weeId = new weeId;
	echo $weeId->numberToWord(1000000);		//hfQ8
	echo $weeId->wordToNumber('hfQ8');		//1000000

Get weeId

Filed under: GitHub, PHP, YouTube No Comments

GitHub for Windows

Works very well!
GitHub Repository Manager for Windows

Filed under: GitHub No Comments

Markdown Live Preview

Markdown is what README files are written in.

Preview your Markdown before you publish
Markdown Live Preview

Filed under: Markdown No Comments

PHP int limit

Integer limit depends on the Architecture of the processor.

32-bit version: 2,147,483,647
64-bit version: 9,000,000,000,000,000,000~

I noticed once I reached large numbers, the modulus function gave incorrect results, and it was because I was using the 32-bit version of PHP

Filed under: PHP No Comments

Default Timezone CodeIgniter

Add this to index.php in the root of the site under the Error Reporting section

//Change America/New_York to your timezone
Filed under: codeIgniter, PHP No Comments

Upgrade PHP on Hostgator

On a Shared Plan:
Edit .htaccess


# Use PHP 5.3
AddType application/x-httpd-php53 .php

That's it!

Filed under: hostGator, PHP No Comments

PHP throw new Exception does not work

"throw new Exception" does not work if you have display_errors turned off in php.ini

Filed under: hostGator, PHP No Comments

Enable Pear Packages on Hostgator

  1. cPanel for Hostgator
  2. PHP PEAR Packages
  3. Search "package you want"
  4. Click "Install"
Filed under: hostGator, PHP No Comments