Archive for the ‘Code’ Category

How to save a PHP object to a database

Thursday, February 11th, 2010

This is an example from a class that deals with user accounts. function save() { if(!$this->id) { ### DUPE PREVENTION $sql = "SELECT id FROM users WHERE username = '" . $this->username . "' LIMIT 1"; $db2 ...

PHP Log Tail Revisitied

Tuesday, February 17th, 2009

The brilliance of programming... Last year I needed to tail a file in PHP. I whipped this out. Today I needed to do it and came up with this: $output = `tail -n 150 /var/log/messages`; $tail_str = "<pre>$output</pre>"; Weee... don't know what the hell I was thinking last time.

Free Online PDF to JPG Converter

Saturday, February 7th, 2009

I had the need to convert a PDF to a JPG today. I searched around on Google and everything was pay to play. This is pure exploitation since this sort of conversion is a one liner for most Linux systems. I wrote my own. File: Depending on your connection ...

Building pdftk (PDF Toolkit) on FC9 and FC10

Tuesday, December 2nd, 2008

The PDF toolkit is command line app for manipulating PDFs. I use it to split faxes received in Hylafax into one file per page. I recently upgraded a server to x86 64 Fedora Core 9 and found that all of the precompiled versions of pdftk wouldn't work. I tried to ...

Learning Flash

Wednesday, November 12th, 2008

I've decided to learn flash. I don't know why, I don't know what I am planning on using it for, but I am going to do it. Here is some example code I wrote up to play around with, it can read in XML outputted from a PHP script and display ...

PHP: Write String to a Jpeg

Monday, October 27th, 2008

This function will dynamically create a jpeg from the string you provide. It even handles multi-line strings. function str_to_jpg($str, $file) { $lines = explode("\n", $str); $number_lines = count($lines); $image = imagecreate(1000, ($number_lines * 16)); $background = imagecolorallocate($image, 0, 0, 0); $text = imagecolorallocate($image, 255, 255, 255); ...



thevedic.net

Part of the thevedic.net.
[Contact Me] - [Mud Emporium] - [Ozark, AR] - [See my Port?]

This site is in no way represents the opinions or positions of any company or organization including those who employ the creators of this web site. We're not responsible for the content, posts, responses by other users or ideas of any sites that are linked to on this page. This site is recommended for ages 18 and up.

VEDIC VEKO IS PROSPEROUS

Arkie Imports | Dean Vaughan | Dean Vaughan | K. Dean Vaughan | Kenneth Vaughan | Pig Trail 23 | Pig Trail Pics | See My Port Forward Info | See My Port Forward Info


I'm not affiliated with the following in anyway.
Arkansas MMA - Inferno Mixed Martial Arts - Inferno Martial Arts Club - Inferno Martial Arts Club - Official Inferno Fight Gear - Inferno Fight Equipment - Inferno Combat Gear - IFC Online - Inferno Fight Gear - Inferno MMA - Inferno Fight Gear