Dave Schwab

  • Welcome
  • About
  • PD Tools
  • QR Maker
Browsing: / Home
Shortlink

Create ‘prefilled’ form fields with jQuery

By Dave Schwab on May 1, 2012 in jQuery, WordPress

I’ve decided to share a little snippet of code that I’ve used for some time now on my web projects. This snip of code allows one to place any value they desire inside a form field and have that value disappear when the field is in focus. When the field is blurred the value reappears IF the field does not contain any user input. It is applied to any field using the class selector of your choice. I’ve chosen .prefilled as mine, but you could make it any class you wish. Continue reading →

Share this on: Mixx Delicious Digg Facebook Twitter
Shortlink

PHP: class_exists() results in an uncaught Exception

By Dave Schwab on February 5, 2012 in PHP

I know they say it’s not a bug, but the other day I was using class_exists() and the spl_autoload() functions to load my libraries. I discovered that class_exists() automatically returns an Exception when the class indeed does not exist! This was a problem, since I had created a custom exception MyException. Continue reading →

Share this on: Mixx Delicious Digg Facebook Twitter
Shortlink

Remove white background in Photoshop

By Dave Schwab on February 5, 2012 in Mindless Drivel

I’ve been working with a website design that includes a black background. Part of the challenge has been taking some of the clip art files that were made to work with a white background and convert them to work with dark backgrounds. Sure you can use the magic want or a clipping mask, two ways that work pretty well when the image is limited to primary shapes like circles and squares. But they are a pain in the rear when you’re working with, say, a three dimensional scene. Continue reading →

Share this on: Mixx Delicious Digg Facebook Twitter
Shortlink

Use a PHP class to connect to a database

By Dave Schwab on September 4, 2011 in PHP

Often times I’ve found myself wanting a quick and easy way to set up a connection to a MySQL database in PHP. In procedural code this was often accomplished by adding a few lines of code atop the first PHP file in the program.

I’ve decided to write an object that uses the constructor to connect to a database and the destructor to disconnect. All I need do now to connect to a database is update the class properties and instantiate the thing. Continue reading →

Share this on: Mixx Delicious Digg Facebook Twitter
Shortlink

Dangerous trend: huffing

By Dave Schwab on August 29, 2011 in Mindless Drivel

So the latest trend in the everlasting pursuit of a high is huffing. A lot of people are surprised when I explain what this is. Since it’s basically getting high where no one though a high was possible, it’s pretty misunderstood. And because it can kill you in under a ten seconds the first time you do it, it’s probably something a lot more people should know about. Continue reading →

Share this on: Mixx Delicious Digg Facebook Twitter
Shortlink

Create a PHP Object

By Dave Schwab on August 25, 2011 in PHP

Object oriented programming was a foreign concept when I first started with it. I grew up writing procedural code all the way back to when I was 6 and coding in BASIC on my Atari 400! Procedural code was the way, but no longer. I am all about OOP now that I’ve grasped the basics and have started creating code for some pretty complicated objects. And as I get more and more into coding, the complexity abounds — but OOP makes complexity fairly straightforward, organized and easy to work with. Continue reading →

Share this on: Mixx Delicious Digg Facebook Twitter
1 2 Next »

Welcome to my site…

Mindless drivel is often popular on the Internet and I figured having a place for such a thing and plastering my name on it might raise a few eyebrows. But who am I kidding, right? Hope you enjoy my foray into the blogosphere!

Categories

  • Football
  • Mindless Drivel
  • PHP
  • WordPress

Interact

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Copyright © 2012 Dave Schwab.

Powered by WordPress and News.