lang="en-US"> 1 Code Snippet a Month Challenge –  Design1online.com, LLC

1 Code Snippet a Month Challenge

This was initially designed as a way for me to challenge myself in creating a code snippet every month that would be useful to online game development. I did pretty well at first but fell behind in the end as life caught up to me. Hopefully you’ll find some of these useful!

Language(s) Name Description
PHP Format Dates Take country into consideration when formatting dates.
PHP Filename From Domain Path If you have http://domain.com/contacts.php this function returns contacts.php
C++ C++ Mysql Database Class Connect to a MySQL database from a C++ application using this nifty class. You’ll need both the .cpp and .h files
PHP Mixing HEX Colors Take two color HEX values and combine them to get their intermediate color. For instance white (#FFFFFF) + black (#000000) = gray (#80000)
MSSQL Remove All But 1 Duplicate Records For those times when you forget to set a key, or set the wrong key — duplicate records are a pain. Here’s an easy way to remove them all in MSSQL.
PHP/Cpanel Dynamically Create an Email name@yourdomain.com Dynamically create an email account for members as they sign up. This assumes you have cPanel already installed and that you have shell exec rights.
PHP Word Functions For all you word puzzle aficionados.
PHP Dynamically Colored Images, Overlays & Transparencies For all those neopet wanna be games out there. Let your members dynamically color their pets any way they like. This requires that you have php compiled with the GD library.
PHP & MySQL PHP Class File Generator Quick and easy php class file generator. Enter your DB connection settings (or save them in an include file), then select the table you want to create the class for. The generator will generate a .php file for download that has the shell of your OOP class.
http://jadendreamer.wordpress.com/2009/08/06/programming-ch…yourdomain-com/

You may also like...

2 Responses

  1. August 6, 2009

    […] Programming Challenge Main Page or Continue to Day 3 […]

  2. August 6, 2009

    […] Programming Challenge Main Page or Continue to Day 4 […]

Leave a Reply