background preloader

Htaccess tester

Htaccess tester
Related:  toolbox

Conditional subpatterns It is possible to cause the matching process to obey a subpattern conditionally or to choose between two alternative subpatterns, depending on the result of an assertion, or whether a previous capturing subpattern matched or not. The two possible forms of conditional subpattern are (? If the condition is satisfied, the yes-pattern is used; otherwise the no-pattern (if present) is used. There are two kinds of condition. The first part matches an optional opening parenthesis, and if that character is present, sets it as the first captured substring. If the condition is the string (R), it is satisfied if a recursive call to the pattern or subpattern has been made. If the condition is not a sequence of digits or (R), it must be an assertion. (? The condition is a positive lookahead assertion that matches an optional sequence of non-letters followed by a letter.

Ajax upload with XMLHttpRequest level 2 and the File API | Phil Parsons I’ve put together a micro Ajax library for the XMLHttpRequest level 2 spec. You can go check it out on Github or read the related article XMLHttpRequest Level 2 Ajax library, xhr2-lib Ajax applications are wide spread these days and one thing that has proven a pain in the arse is uploading files. I’m sure most people will have fired off a fake asynchronous upload to a hidden iframe or used a sneaky swf to handle it but now with the development of the level 2 specification for the XMLHttpRequest object some of those woes may soon (if you are ok about not supporting IE) be a thing of the past. The FileReader API and the DataTransfer object One of the coolest things I’ve messed about with so far in HTML5 is the FileReader and File APIs and their ability to read in files from the users computer. XMLHttpRequest object send() with File In the level 2 specification the send method can accept a File object argument which allows us to stream binary chunked data to the server asynchronously. Summary

mod_rewrite cheat sheet | mod_rewrite reference with useful examples. WAVE Web Accessibility Evaluation Tool Archiver un site en local method_exists() vs. is_callable() One thing I often see when re-factoring PHP applications, is the improper use of the method_exists() function, and I think this needs a little bit of clarification. Here is a typical example of what I’m talking about: The purpose of this code snippet is quite easy to understand (even if I don’t encourage to do this kind of not-very-OOP-stuff): having an object named “$object”, we try to know if it has a method named “SomeMethod”, if so, we call it, and provide some arguments to it. This code will probably run very well during all its lifetime, but what if the object’s method is not visible from the current scope (like… a private or protected method)? The real intent of the previous code snippet was in fact to know if the application could call a method on the object, from the current scope. This is why (among other reasons) is_callable() is part of the PHP built-in functions. Here is another snippet of code to illustrate the differences between method_exists() and is_callable() in action:

Caching API responses with PHP | Phil Parsons Most websites have some kind of widget that fetches data from an external RESTful API provided by services such as Twitter, Flickr and Facebook to name just a few. These APIs often limit the amount of hits any one Domain/IP can make and if you go over your rate limit then pow, no data for you and an empty widget. This PHP class gives you a mechanism to cache your API responses locally and only update them on a set time interval so you always stay within the rate limits for each API call you make from your site. API_cache.php The class accepts a URI for your API call, a filename to write to (if this is not in the same directory as the class you will need to make sure that directory exists), and a time period for how long you wish to cache the response for. Using the API_cache class effectively Here is an example usage of the class taken from the demo.

HTML Purifier - Filter your HTML the standards-compliant way! Photopea | Online Photo Editor Responsive Image Breakpoints Generator by Cloudinary DomainByIP.com - Find websites hosted on the same IP-address Special effects using imagefilter() | Practical PHP Programming bool imagefilter ( resource image, int filter_type [, int parameter1 [, int parameter2 [, int parameter3]]]) The filters described here were written for the PHP-bundled build of GD, and may not be available in other releases. This is quite an odd function, as it happens, because the number of arguments you need to pass to it vary depending on the effect. The best way to explain this function is simply to explain briefly how it works then show a code example, so let's get started straight away. No matter what, the function returns true if the filter was applied successfully and false otherwise. First up is IMG_FILTER_BRIGHTNESS, which takes a number between -255 and 255 that represents how much you want to brighten or darken the image. This code example will lighten our space picture just a little: Next up is IMG_FILTER_COLORIZE, which takes three parameters between -255 and 255 that respectively represent the red, green, and blue values you want to add or subtract from the image. Jump to:

3 Solutions for Supporting Internet Explorer In the beginning, Internet Explorer was the progressive browser. After a period of inactivity, Internet Explorer became the bane of our existence. Microsoft has since recommitted to their browser but the fact remains that sometimes modern Internet Explorer is lagging just a bit behind WebKit-based browsers and Firefox. We also need to accommodate for earlier versions of IE. The following will allow your sites to quickly and almost magically work better in Microsoft's flagship browser! htmlshiv.js Remy's HTML5shiv creates HTML5 elements like main, header, footer, etc. via JavaScript. selectivizr.js Selectivizr.js is an incredible resource, polyfilling loads of unsupported CSS selectors and properties, including the all-important last-child. An absolute must for your modern projects. <html> Conditional Comments The ugliest conditional comment series you'll ever see. This snippet doesn't require or wait on JavaScript, and isn't near the weight of a JavaScript library.

DNS Checker - Worldwide DNS Propagation Checker

Related: