Tag Archives: tip
-webkit-box-shadow (in Webkit nightly) and -moz-box-shadow support inner shadows with the inset keyword. Both also support multiple shadow declarations separated by commas.
Want to achieve the box pictured above?
div.box {
-webkit-box-shadow: 0 3px 3px rgba(0,0,0,0.20), rgba(0,0,0,0.12) 0px 0px 10px inset;
-moz-box-shadow: 0 3px 3px rgba(0,0,0,0.20), rgba(0,0,0,0.12) 0px 0px 10px inset;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border: 1px solid #fff;
padding: 6px;
width: 200px;
background: #fff;
}
There’s a very convenient shell script bundled with some distributions of OpenSSH called ssh-copy-id. It seems not to be the case with Leopard’s SSH.
In order to get it, we can simply check it out of a SVN repository. Execute this two commands:
sudo curl "http://www.chiark.greenend.org.uk/ucgi/~cjwatson/cvsweb/openssh/contrib/ssh-copy-id?rev=1.8;content-type=text%2Fplain" -o /usr/bin/ssh-copy-id
sudo chmod +x /usr/bin/ssh-copy-id
And you’re done!
if ( comments_open() ) { ?>
Not a big fan of the Web Developer toolbar? Me either! But I do use the logging system quite a bit. Thankfully, OS X ships with an useful application called Console that comes to the rescue.
- Open the Console application
- Go to File > Open and browse to your
frontend_dev.logor desired log file in the symfony logs directory - Click
Show Log Listand select your newly opened file to avoid the clutter of the rest of the OS logs - You’re done! You can now take advantage of features like clearing the view, search, and more
If you upgraded to PHP 5.3, chances are high you’re going to run into a few warnings or deprecated function messages.
An example is the ereg family of functions, which are gone for good, as they were slower and felt less familiar than the alternative Perl-compatible preg family.
To migrate ereg():
ereg('\.([^\.]*$)', $this->file_src_name, $extension);
becomes
preg_match('/\.([^\.]*$)/', $this->file_src_name, $extension);
Notice that I wrapped the pattern (\.([^\.]*$)) around / /, which are RegExp delimiters. If you find yourself escaping / too much (for an URL for example), you might want to use the # delimiter instead.
To migrate ereg_replace():
$this->file_dst_name_body = ereg_replace('[^A-Za-z0-9_]', '', $this->file_dst_name_body);
becomes
$this->file_dst_name_body = preg_replace('/[^A-Za-z0-9_]/', '', $this->file_dst_name_body);
Again, I just added delimiters to the pattern.
If you are using eregi functions (which are the case-insensitive version of ereg), you’ll notice there’re no equivalent pregi functions. This is because this functionality is handled by RegExp modifiers.
Basically, to make the pattern match characters in a case-insensitive way, append i after the delimiter:
eregi('\.([^\.]*$)', $this->file_src_name, $extension);
becomes
preg_match('/\.([^\.]*$)/i', $this->file_src_name, $extension);