An Introduction to Bower

  • Filed Under: Django
  • By Corey Maynard
  • Nov 7, 2015

Lets start a Django project using virtualenv and Bower

I've written about virtualenv before, so I won't go that much into detail about it this time. Suffice to say that virtualenv allows you to work in isolated Python environments where your project will not be influenced by any Python packages that exist on your system. This makes dependencies much easier to resolve when it omes time to deploy to production, as you know exactly what your project requires.

Lets get started

Making a ...

Read More

Performing AJAX POST Requests in Django

  • Filed Under: Django
  • By Corey Maynard
  • Jun 11, 2014

A common pitfall that shows up when developing a Django application is when you try and make your first POST request to your server from AJAX. As a response you receive a helpful 403 FORBIDDEN notice, and not much other information. There's a fairly simple way of handling this issue in a seamless fashion, which I'll cover here, and then we can take it a little bit further.

Firstly, let's discuss the actual problem that is causing this. Django comes with a security feature called Cross Site Re...

Read More

Introduction to Composer

  • Filed Under: PHP
  • By Corey Maynard
  • Dec 14, 2013

Explaining the Need

Projects in today's world are not developed in isolation. There are so many incredibly intelligent people out there writing code to solve the common problems experienced in nearly every web application that some very impressive solutions have been developed. When you begin working on a new application there's no need for you to implement something that's already been done, so you bring that external code into your application to make use of it.

You've just introduce...

Read More

Creating a RESTful API with PHP

  • Filed Under: PHP
  • By Corey Maynard
  • May 17, 2013

10 Comments

First, Some Background

What is REST?

REST, or in the full form, Representational State Transfer has become the standard design architecture for developing web APIs. At its heart REST is a stateless client-server relationship; this means that unlike many other approaches there is no client context being stored server side (no Sessions). To counteract that, each request contains all the information necessary for the server to authent...

Read More

Adding jQuery Event Listeners to Dynamically Created Django Admin Inline Model Fields

  • Filed Under: Django
  • By Corey Maynard
  • Apr 10, 2013

1 Comment

That title has enough keywords to open a safe, yet it is exactly what we're going to be talking about here.

The Django Admin is an incredibly powerful asset that the framework brings to the table; it takes care of dealing with all the CRUD (Create, Read, Update, Delete) operations inherit in every database for you. As an additional plus, it does this in fashion that is incredibly easy to activate and use with any Django project. More often than not, the base functionality of the admin will ta...

Read More

Adding the PHP Documentation to Vim

  • Filed Under: Linux , PHP , Vim
  • By Corey Maynard
  • Mar 28, 2013

The PHP documentation at php.net is an awesome resource to have. Though I may have some complaints about the language as a whole, I think the documentation itself is very good. They've done an excellent job at thoroughly documenting the language, providing examples of the functions in use, and linking between similar functions. I find myself frequently visiting the docs site throughout the development process to look up return values, parameter orderings, and code examples. Thi...

Read More

Using Google's Closure to Compile and Verify your JavaScript

7 Comments

A large application is nearly guaranteed to come with an equally large amount of JavaScript attached to it. During development it makes sense to divide the JavaScript of the application into multiple sensibly named files both to make finding specific functionality in the code base easier, and to keep the file length to a reasonable size for readability/comprehension purposes. More importantly though, this allows you to build modular, reusable components by separating functionality and sharing co...

Read More

Finding what Stinks, and Cleaning up the Mess

  • Filed Under: PHP , Vim
  • By Corey Maynard
  • Jan 16, 2013

The Importance of Consistency

When writing any sort of code it is important that things be written properly; while what exactly is 'proper' is open for discussion, what is undeniable is that having a standard and convention on how you write your code will save you hours of stress and frustration later. This is most obvious when you try and track down the scattered instances where someone is using $username, and someone else is using $user_name, or if you're trying to remember if the funct...

Read More

Leveraging the Power of Abstract Classes

  • Filed Under: PHP
  • By Corey Maynard
  • Dec 20, 2012

What is an Abstract Class?

You can create an Abstract class in just about every common language these days. An abstract class is unlike regular classes (Concrete Classes) in that it can not be instantiated. It may contain callable methods, but the class itself can never be created. If it can't be instantiated, then what good is it? Well, its purpose is to be used as a base class to provide common methods to a set of concrete classes that extend the abstract. This is incredibly useful in a...

Read More

Magic in PHP

  • Filed Under: Job , PHP
  • By Corey Maynard
  • Dec 12, 2012

A brief overview of OOP

Before we move on to some more interesting things, let's quickly talk about what exactly Object Oriented Programming, or OOP, actually is. One can think of OOP as an evolution of Procedural Programming. In procedural programing one breaks down a task into an ordered set of steps and methods to achieve the desired goal; for OOP you create 'objects' that operate on self contained data and procedures. This encourages modular programing as you work to make it so that e...

Read More

Not Enough?

Demand to see more! View Older Posts