Bookmarks

Installing the INTL extension on MAMP

2012/01/07 | Permalink | Comment?

Install the INTL extension with MacPort intalling php5-intl (sudo port install php5-intl), then copying the library to MAMP:

cp /opt/local/lib/php/extensions/no-debug-non-zts-20090626/intl.so /Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/

Check the correct folder.

Maybe you will need to change the architecture of the MacPort compiler because MAMP is compiled in 32bit

# /opt/local/etc/macports/macports.conf
build_arch i386

Installing the INTL extension on MAMP | Geert Van Damme.

Tags: , , ,

Bookmarks, Code Snippets

Change PHP settings with Apache directives

2012/01/02 | Permalink | Comment?

Suppose you have to change some PHP settings for specific projects or directories. Well, you can do so using four useful Apache directives, directly in your Apache configuration files, or even in .htaccess files. To change the value of a boolean directive use the following Apache directive:

php_flag [directive_name] on|off

To set the value of a non-boolean directive you can use the following Apache directive:

php_value [directive_name] [value]

Last, you can also use the two following directives, which behaves like the previous two directives, respectively, with a small difference. When you set a value using these directives, you can’t override it in the .htaccess file. And obviously, you can’t use them in that file.

php_admin_flag [directive_name] on|off
php_admin_value [directive_name] [value]

For example, if you want to alter the error reporting rules for a specific virtual host, just use something like this in the virtual host configuration:

php_flag display_errors on
# Equal to "E_ALL | E_DEPRECATED"
php_value error_reporting 30719

Finally, remember that you cannot use the various PHP constants. You must use the numerical codes in place of them. E.g. E_DEPRECATED is 8192. Note that you can’t add comments in the same line of the directive: put it before or after! Otherwise Apache will not start up!
For computing the value of the combination of two or more constants (like in the example above), you can use a PHP script like the following one:

<?php

echo (E_ALL | E_DEPRECATED); # Prints 30719

Enjoy!

Tags: , , , ,

Bookmarks

Selectivizr: CSS3 pseudo-class and attribute selectors for IE 6-8

2011/12/27 | Permalink | Comment?

selectivizr is a JavaScript utility that emulates CSS3 pseudo-classes and attribute selectors in Internet Explorer 6-8.

via Selectivizr – CSS3 pseudo-class and attribute selectors for IE 6-8.

Tags: , , ,

Bookmarks

When should I use article, section or div html5 tags?

2011/12/15 | Permalink | Comment?

There’s been a lot of confusion over the difference (or perceived lack of a difference) between the <article> and <section> elements in HTML5. The <article> element is a specialised kind of <section>; it has a more specific semantic meaning than <section> in that it is an independent, self-contained block of related content. We could use <section>, but using <article> gives more semantic meaning to the content.

By contrast <section> is only a block of related content, and <div> is only a block of content. Also as mentioned above the pubdate attribute doesn’t apply to <section>. To decide which of these three elements is appropriate, choose the first suitable option:

1. Would the content would make sense on its own in a feed reader? If so use <article>

2. Is the content related? If so use <section>

3. Finally if there’s no semantic relationship use <div>

Dr Bruce has written HTML5 <article>s and <section>s, what’s the difference?, so we recommend reading that if you are still fuzzy on when to use <article>.

via The article element | HTML5 Doctor.

Tags:

Bookmarks

Online Image Map Editor

2011/12/01 | Permalink | Comment?

Map an image can be really annoying, so you need a valid tool to do it. Do it easier with the online image map editor of maschek

maschek.hu – Online Image Map Editor.

Tags: , ,

Bookmarks

Webcam snapshots with jQuery

2011/11/30 | Permalink | Comment?

Have you ever thought about how can you take a picture from a user’s webcam? Here is a simple plugin for jQuery, which lets you control the webcam through javascript, and requires only that you place a small flash object in the web page.

Via xarg.org

Tags: , , ,

Code Snippets

Recursively delete .svn directories

2011/11/26 | Permalink | Comment?

Delete recursively all .svn files and folders.

rm -rf `find . -type d -name .svn`

via Recursively delete .svn directories.

Tags: , ,

Bookmarks

PHP 5.2 to 5.3 migration tool

2011/11/20 | Permalink | Comment?

The script is very simple in use – just run php migrate.php myscript.php or php migrate.php directory/ and see if youll get any warnings. If you get none, the script thinks your code is ok Running php migrate.php -h displays help.I have placed the script on github – http://github.com/smalyshev/migrate

via DevZone » 5.2 to 5.3 migration.

Tags: ,

Bookmarks

How to fix missing shortcut icons in VS 2010 setup projects

2011/09/21 | Permalink | Comment?

Several developers are having problems with the creation of shortcuts pointing to the application in Setup Projects created using Visual Studio 2010. Shortcuts are created the same way of VS 2008, but the problem with VS 2010 is a bug  with icons management. Even if you set an icon (either a .ico or a .exe file) for the shortcut, the installer creates a shortcut with an ugly icon that looks like a blank document. This same icon is used also in the add/remove panel. (more…)

Tags: , , , , , , , ,

Code Snippets

Fixing the Cant move .svn/tmp/entries to .svn/entries error

2011/07/31 | Permalink | Comment?
chflags -R nouchg ./

via Fixing the Cant move .svn/tmp/entries to .svn/entries error | Arc90 Blog.

Tags: , ,
« Previous Entries