I hereby claim:
- I am gadhra on github.
- I am gadhra (https://keybase.io/gadhra) on keybase.
- I have a public key ASDRwV4s21uAk065SijxZa00T1EKr6oX2SPL02-BX74UOAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| <?php | |
| /** This may be one of the most useless files in the world, but it essentially encapsulates | |
| * the answers to as many interview questions as I can remember over the years. Written in PHP | |
| * because ... just because. | |
| **/ | |
| /** | |
| * Write me a program that can determine if something is a palindrome | |
| * ex. A man, a plan, a canal - Panama! should count |
| <?php | |
| /** | |
| * Rich Text cleaner | |
| * | |
| * This function pulls out rich text quotes and dashes, usually from Word or other rich text editors | |
| * | |
| * @author Mango | |
| * @link http://www.toao.net/48-replacing-smart-quotes-and-em-dashes-in-mysql | |
| * @param string $text text to clean up | |
| * @return string |
| #!/usr/bin/python | |
| """ | |
| This file takes a url of an image, resizes it, and SFTPs the new | |
| image to a new location. The image URLs are stored in a MySQL db in | |
| my case, but YMMV | |
| """ | |
| import urllib2 | |
| import Image as pil | |
| import paramiko as ssh_c | |
| import os |
| <?php | |
| /** | |
| * @note Qmail popper::PHP4::qmail-popper-php | |
| * @author Stefan Antonowicz | |
| * | |
| * This file parses out the mails sent to qmail via stdin. | |
| * | |
| * @author Stefan Antonowicz | |
| */ |
| #!/usr/bin/python | |
| #@note python pinger::Python::python-pinger | |
| import os | |
| import sys | |
| import re | |
| import smtplib | |
| import MySQLdb | |
| from email.MIMEText import MIMEText | |
| webservers = ["192.168.0.1", "192.168.0.2"] |
| <?php | |
| /*** | |
| * @note session handler::PHP5::session-class-php | |
| * @author Stefan Antonowicz | |
| * @link http://us2.php.net/manual/en/function.session-set-save-handler.php | |
| * | |
| * Database session handler | |
| * | |
| * This class overwrites the default session save functions for PHP, so we | |
| * can write to the database rather than the filesystem |
| <?php | |
| /** | |
| * @note MySQL class::PHP5::php-mysql-class | |
| * @author Stefan Antonowicz | |
| */ | |
| class MySQL { | |
| private static $db = ''; | |
| /** | |
| * Acceptable connection options - only static and persistent in this case | |
| * @access private |
| <?php | |
| /** | |
| * Warning: I'm using the v3.0 Protocol here, which hasn't "graduated" yet. | |
| **/ | |
| /** basic setup **/ | |
| $ch=curl_init(); | |
| $h_auth=array(); | |
| $h_docs=array(); | |
| $save_dir = '/dir/to/save/your/file'; |