Category Archive for 'How To'
Monday, February 22nd, 2010
(This is edited from an answer I posted to KeyMinor, a music Q&A site. They need more users!)
A lot of recordings end up slightly higher/lower than standardized pitch (I always called this “in the cracks” but don’t google it!), and this is the quickest way I’ve found to tune a guitar to them. This method [...]
Posted in How To, Music | No Comments »
Monday, February 15th, 2010
Tests for and removes UTF8 BOMs.
#!/bin/bash
for F in $1
do
if [[ -f $F && `head -c 3 $F` == $'\xef\xbb\xbf' ]]; then
# file exists and has UTF-8 BOM
mv $F $F.bak
tail -c +4 $F.bak > $F
[...]
Posted in How To, Linux | No Comments »
Thursday, January 28th, 2010
Posted in How To, Linux, PHP, Web Design | No Comments »
Friday, January 15th, 2010
Our Ubuntu web host, hosted with OSG, was not able to send mail (using PHP mail) outside of UF. An OSG tech said our From: header should be a valid address at UF (check) and that the logs at smtp.ufl.edu showed those messages never made it there.
The solution was to configure sendmail to use smtp.ufl.edu [...]
Posted in How To, Linux, PHP, Web Design | No Comments »
Friday, November 6th, 2009
Due to web images being optimized for on-screen display (let’s say 96 DPI), images on printed pages are usually blurry, but they don’t have to be:
Start with a high-resolution image. E.g. 2000 x 1000.
Save a version with dimensions that fit well in your printed layout when placed in an IMG element. E.g. 300 x 150.
In [...]
Posted in CSS, How To, Web Design | No Comments »
Tuesday, March 3rd, 2009
(updated 3/4 to include the “Serving from clusters” case)
As I see more server scripts implementing conditional GET (a good thing), I also see the tendency to use a hash of the content for the ETag header value. While this doesn’t break anything, this often needlessly reduces performance of the system.
ETag is often misunderstood to function [...]
Posted in How To, Web Design | 2 Comments »
Wednesday, January 14th, 2009
Dad forwarded an e-mail that tried to simplify the difference between HTTP and HTTPS and I wanted to add a bit to that.
Think of HTTPS as a secure telephone line
No one can eavesdrop, but don’t assume HTTPS is “secure” unless you know who’s on the other end. Evil and good-but-poorly-managed web sites can use HTTPS [...]
Posted in How To | No Comments »
Wednesday, October 8th, 2008
While trying to run the initial test scripts included with phpQuery 0.9.4 RC1, I got the following warning:
Warning: domdocument::domdocument() expects at least 1 parameter, 0 given in C:\xampp\htdocs\phpQuery-0.9.4-rc1\phpQuery\phpQuery.php on line 280
This is strange because DOMDocument’s constructor has only optional arguments.
As it turns out, XAMPP for Windows ships PHP with the old PHP4 “domxml” extension enabled [...]
Posted in How To, PHP | 1 Comment »
Friday, September 19th, 2008
A new release of Minify is finally out, and among several new features is the “min” application that makes 2.1 a snap to integrate into most sites. This post walks through the installation of Minify 2.1 on this site.
Posted in CSS, How To, Javascript, PHP, Web Design | 11 Comments »
Tuesday, June 3rd, 2008
Recently I configured Apache to serve pre-encoded files with encoding-negotiation. In theory this should be faster than using mod_deflate, which has to re-encode every hit, but testing was in order.
My mod_deflate setup consisted of a directory with this .htaccess:
AddOutputFilterByType DEFLATE application/x-javascript
BrowserMatch \bMSIE\s[456] no-gzip
BrowserMatch \b(SV1|Opera)\b !no-gzip
and a pre-minified version of jquery-1.2.3 (54,417 bytes) saved as “before.js”. [...]
Posted in How To, Web Design | 2 Comments »