Today I learned how to make a HTML element’s width equal to its contents.
Basically you use CSS and set the element’s “display” property to “inline-block”.
Today I learned how to make a HTML element’s width equal to its contents.
Basically you use CSS and set the element’s “display” property to “inline-block”.
Today I enabled the allow_url_include configuration option in PHP on Apache on ProgClub MemberNet. This allows me to include a source file directly from svn, e.g.:
require_once( 'https://www.progclub.org/svn/pcrepo/slib/trunk/src/uri.php' );
Finally got around to making my MemberNet web-page look nice and pretty. Also integrated the look and feel with all of my PHP tests.
I learned about the PHP get_called_class function today. Basically it returns the name of the class that the function that’s running is defined in. Handy for figuring out which class a static method is running in. Compare with get_class.
The file function parses a text file into an array, and the file_get_contents function returns a text file as a string.
Today I discovered the user_agent php.ini configuration option. Basically it allows you to specify the user agent PHP uses when it sends HTTP requests for files. I was screen scraping some data from Wikipedia (processing URI schemes) and it was replying with a 403 error, presumably because they’ve banned the default PHP user agent. Anyway I just changed my user agent to a copy of my one from Firefox and things started working. Pretty handy option!
I used the CSS overflow Property today and set it to ‘auto’ so that my code fit on the screen.
pre { overflow: auto; }
I used the CSS :last-child and :after selectors to hack the content: property on my menu lists. Basically items in the menu have a pipe ‘|’ between them, except no pipe before or after the list. I did that in CSS with:
#menu li:after {
content: ' | ';
}
#menu li:last-child:after {
content: '';
}
Thanks to this handy document How To Set Cron to Run Every 5 Minutes I now my crontab configured so that my jj5-test repo gets updated every five minutes. It’s the sort of thing I generally do in a post-commit hook, but in this case that won’t work owing to the way the servers are configured (the files are in my account and not owned by the www-data user the commit-hook runs as).
So to configure cron I issued the command:
$ crontab -e
And then to update my svn working copy:
# m h dom mon dow command */5 * * * * cd /home/jj5/web/test && svn update > /dev/null
On my list of things to do is read the document Handling character encodings in HTML and CSS from the W3C. For some reason I can’t quite bring myself to concentrate on it right now.