mrkeck Sharing the Love

30Apr/130

PHP use / not \

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

Filed under: Convention, PHP No Comments
26Apr/130

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
26Apr/130

Youtube Like IDs

Shorter IDs = Shorter URLs

weeId.com/id/1000000 => weeId.com/id/hfQ8

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

Usage

	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
26Apr/130

GitHub for Windows

Works very well!
GitHub Repository Manager for Windows

Filed under: GitHub No Comments
26Apr/130

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
22Apr/130

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
22Apr/130

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
date_default_timezone_set('America/New_York');
Filed under: codeIgniter, PHP No Comments
22Apr/130

Upgrade PHP on Hostgator

On a Shared Plan:
Edit .htaccess

Add:

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

That's it!

Filed under: hostGator, PHP No Comments
22Apr/130

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
22Apr/130

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