Combining Javascript Files to Reduce HTTP Requests

Posted by:

I just wanted a very basic PHP script to combine all my JS files into one – no minification, just bring them together into one file.

// compress the file using GZIP
// javascript content-type
header('Content-type: text/javascript');
// define the files you want to combine
$files = array('jquery.js', 'app.js', 'somePlugin.js');
// combine the files
foreach($files as $file) {
// get the contents of this file
$content .= file_get_contents($file) . '
'; //add a new line
// output the contents
echo $content;
Continue Reading →

Resizing High Resolution (Hi-res) JPEG Images with PHP

Posted by:

I kept running into a problem when I uploaded high resolution (14MP) images and tried creating thumbnails with them. The issue turned out being the PHP script ran out of memory. So it was a simple increase to about a half gig (512MB) and the script ran perfectly. Here’s the code:


ini_set ( "memory_limit", "512M");
echo createThumb($_GET["src"],$_GET["w"]);
function createThumb( $path, $thumbWidth ) 
$info = pathinfo($path);
// continue only if this is a JPEG ...
Continue Reading →

New Twitter API (v1.1) Quick Start

Posted by:

This tutorial will help you get started with the new Twitter API which will be much different than the deprecated 1.0 version. In this example we’ll look at how to get a user’s timeline via the API.

  1. Setup your developer account if you haven’t done so yet at
  2. Go to and create your app
  3. Once created click on the Keys and Access Tokens tab and Create Access Tokens (for this example we only need Read access but for ...
Continue Reading →
Page 1 of 11 12345...»