Web development
Nixer: a CSS-only theme for Drupal
When I first setup Drupal on this site, I had pretty much decided that I would use an existing theme from Drupal's theme repository. And for a while, I did. I reviewed a lot of different themes, from very basic themes to more visually appealing ones. I eventually settled on one or two and gave it a go. This worked okay for a while but over time, I came to the realization that:
- themes can have bugs too (some serious)
- debugging other people's CSS and PHP is a lot of work
- heavy themes can really slow down your site
Using z-index to control layers in CSS
When arranging CSS block elements on a web page, the blocks will sometimes overlap whether it is intentional or not. When viewing the resulting page, these overlapping blocks may not be noticeable because the actual contents of the blocks do not overlap. In such a scenario, the designer may decide not to do anything further since the contents of these overlapping blocks display as desired.
CSS: Unaccounted for space underneath an image
Web designers, especially those who work with CSS and XHTML understand the importance of pixel-level control. Page layouts are often done with pixel precision. That's why when the page rendering deviates from the designer's expectations based on the written source code, it can be extremely frustrating.
Nesting multi-line comments in CSS
Multi-line comments in CSS follow the C style of commenting. The beginning of the block is indicated by a /* and the end of the block is indicated by */. For example, in the following block:
#header {
/* margin-top: 10px;
margin-bottom: 10px;*/
float: left;
clear: both;
}
Securing Drupal admin pages with http authentication
You can add of layer of security to your Drupal installation by requiring http authentication to access Drupal's admin pages. This authentication would happen outside of drupal and as such, may be less susceptible to certain types of attacks. Certainly, if there is a security hole in Drupal that can be exploited without any interaction with the admin interface, this technique won't help at all. But it may act as a deterrent in some cases.
Tuning Apache's MaxClients setting
In apache 2, the MaxClients directive in your apache configuration will determine the maximum number of server processes allowed to start. As you probably guessed, it's a very important directive. If you reach the limit, you'll get a very friendly message in your apache error log saying:
[Thu Oct 18 06:22:19 2007] [error] server reached MaxClients setting, consider raising the MaxClients setting
Is Drupal slow and bloated?
I came across a couple of interesting articles today:
Using CSS to prevent arbitrary line breaks at slashes (/)
In working with HTML, many of you have probably dealt with the issue of unsightly line breaks being inserted by the browser from word wrapping. Automatic word wrapping is usually quite predictable, happening when the browser meets whitespace or a hyphen. You can use special characters to control whether the wrap happens or not, e.g. a non-breaking space ( ) or a non-breaking hyphen (‑). But did you know that word wrap also happens at slash (/) characters?
For example, take a look at the following line:
How to display XML code on an HTML page
There may be instances when you want to show sample XML code on a web page. I'm referring to the raw XML code with any and all markup intact. When the browser believes that the entire page is an XML page (because the page begins with an XML declaration), it will usually do the right thing and display the XML. If, however, you have the XML on an HTML page, the XML markup will be read by the browser instead of displayed.
For example, here is some sample XML data:
<?xml version="1.0" encoding="ISO-8859-1"?>
<text>
<to>John</to>
Picture in the header was taken at Hetch Hetchy
In case you were wondering about the picture in the header, it was taken at Hetch Hetchy Reservoir several years ago. The structure on the left is a small bridge overlooking the valley and reservoir, and you can just get a glimpse of a waterfall to the side of the bridge. The crop perhaps doesn't capture how beautiful the scene was when I took the picture.
Recent comments
6 min 46 sec ago
9 min 58 sec ago
16 min 40 sec ago
21 min 31 sec ago
21 min 48 sec ago
22 min 59 sec ago
24 min 36 sec ago
25 min 41 sec ago
25 min 46 sec ago
28 min ago