Using Nginx and Apache together on Ubuntu

Apache, Django, Magento, Nginx, Ubuntu, Wordpress

I am beginning a new project that uses MEAN.JS (MongoDB, ExpressJS, AngularJS, Node.js). I use Apache as my webserver on my local Ubuntu VM. When I first read about using Express, I wondered how I would use Express and Apache together. Further confusion came when I learned that my host provider (webfaction uses Nginx to serve static files and Apache for PHP and other server-side technologies. So Node.js and Express will actually be running under Nginx. Because I wanted my development environment to be enulate production as much as possible, I decided to run Nginx and Apache together.

Continue reading

Checkout My New Site - T-shirts For Geeks

Mobile Theme Generator for WordPress and Tumblr

Ajax, Django, Javascript, JQuery, Mobile

A few months ago, I downloaded a mobile theme for WordPress in order to create a mobile site for GrasshopperPebbles. While updating the template, I thought about automating the development process so that future releases would be easier. So I decided to create an open source project – the mobile theme generator. The generator displays mobile sites using jQuery Mobile. In fact, the generator itself was developed using Django and jQuery Mobile (the original theme used jQuery Mobile). I did think that it an odd solution to create PHP files using Python, but it turned out to be a great solution.

Continue reading

Checkout My New Site - T-shirts For Geeks

WordPress: Sharing database content between primary and sub-domains

Wordpress

After I created my mobile WordPress theme using the the Mobile Theme Generator that I created on MobilePebbles.com, I had to figure out the best way to share the database between my primary domain and the mobile sub-domain (m.grasshopperpebbles.com). There are a couple of strategies for switching between a desktop view and a mobile view. I decided that I didn’t want to do an automatic switch to the mobile sub-domain by using a mobile device sniffing method. I think that it is a better strategy to let the user decide whether they want to switch to a mobile view. So I set up a sub-domain and created a link at the top of my site that points to my mobile view.

Continue reading

Checkout My New Site - T-shirts For Geeks

Using the YUI Loader Utility

Ajax, YUI

The YUI Loader Utility is a client-side JavaScript component that allows you to load specific YUI components and their dependencies into your page via script. While I haven’t used the YUI Loader Utility that often, I like using the utility beacause I don’t have to remember all of the dependencies needed by each component. In addition, I can use the loader utility to load any custom plugins.

Continue reading

Checkout My New Site - T-shirts For Geeks

Learning Drupal – Step 1: Themes

Drupal, Pebblet, PHP

I have been a PHP developer for many years and I have recently started learning Drupal 6. I struggled for a few days just trying to modify one of the existing themes. If any of you are just starting to learn Drupal and you want to create your own design/theme, I found that the easiest way is to first create your design template (HTML and CSS) without the PHP/Drupal code. Once your design is complete and can be viewed correctly in the modern browsers, then  open up one the themes (page.tpl.php) that are installed with Drupal and copy/paste the revelant PHP code into your template. I also use this approach when I create WordPress themes.

Before you begin your design, make sure that you have a fairly good understanding of Drupal’s Regions, Blocks and Modules and Blocks (Blocks are placed into Regions). Namely, header, left side, right side, and footer. You don’t necessarily have to use all regions in your design (i.e., you may not need a right side), but you should have a good understanding of what each region can be used for.

When I created my first Drupal theme, I did not think that I needed a right side, so I did not create one. But after I looked at other websites that use Drupal (and the many contributed modules), I found some very good content ideas that can be placed on the right side of my Drupal theme template.

I will, from time-to-time, post other Drupal tidbits (as I learn them).

Checkout My New Site - T-shirts For Geeks