Categories
Tags
Author Archives: Garrett
PHP: Format a number to a certain # of decimal places without rounding
One way to doit: $val = 7.5678; echo bcdiv($val, ’1′, 1); //Will produce 7.5 echo bcdiv($val, ’1′, 2); //Will produce 7.56 echo bcdiv($val, ’1′, 3); //Will produce 7.567 @see http://php.net/manual/en/function.bcdiv.php
Posted in Uncategorized
Leave a comment
Remove password from ssl key file
openssl rsa -in keywithpassphrase.key -out keywithoutpassphrase.key
SSH Options
Keep the connection alive
Checking response headers using the command line (console)
Use the command below to view the response headers for a given URL. The “–spider” option in the call prevents wget from actually downloading the page/file; it just checks that it exists and returns the headers. References http://www.gnu.org/software/wget/manual/html_node/Download-Options.html
Installing Doctrine ORM in a Zend Framework Application
UPDATE: 2012-04-30 The instructions below have been updated for compatibility with Zend Framework 1.11.11 and Doctrine 2.2.2 . There are a number of methods for integrating Doctrine into a Zend Framework application. Many of the examples on the web detail … Continue reading
Zend Framework Application Setup
Over the past several years I’ve created a number of Zend Framework applications. For my projects I’ve found that a “module” based directory structure works best. The following describes how I setup my applications using a modular based directory structure.
Ubuntu 10.10 and my iPhone
I was getting errors whenever I connected my iPhone to a USB port while running Ubuntu 10.10 … the following fixed me up: … I found this @ https://bugs.launchpad.net/ubuntu/+source/dbus/+bug/652617/comments/14
Posted in The Garage
Leave a comment
First Seattle PHP Meetup
Just attended my first meetup/seattle-php-meetup. Looking forward to the next one.
My Logitech Marble Mouse: Ubuntu 10.10
1. Create the following file /usr/share/X11/xorg.conf.d/50-marblemouse.conf 2. Paste into the file: Section “InputClass” Identifier “Marble Mouse” MatchProduct “Logitech USB Trackball” MatchIsPointer “on” MatchDevicePath “/dev/input/event*” Driver “evdev” Option “SendCoreEvents” “true” # Physical buttons come from the mouse as: # Big: 1 … Continue reading
Posted in The Garage
1 Comment
Memory: Clearing the cache
> sync > echo 3 > /proc/sys/vm/drop_caches