SnipPets » History » Revision 3
« Previous |
Revision 3/7
(diff)
| Next »
Simon, 06/02/2010 06:45 PM
= Snippets =
Remove trailing whitespaceshttp://jimbojw.com/wiki/index.php?title=How_to_find_PHP_files_with_trailing_whitespace
'''Command Line :'''
{{{
echo '\\s\\s+\\Z/m", file_get_contents($file))) echo("$file\n");} ?>' | php
}}}
'''PHP file script :'''
{{{
foreach (glob('**/*.php') as $file){
if (preg_match('/\\?'.'>\\s\\s+\\Z/m',file_get_contents($file)))
echo("$file\n");
}
?>
}}}
{{{
for /r repository %f in (.svn) do rd /S /Q "%f"
}}}
from : http://www.jonathan-petitcolas.com/fr/supprimer-recursivement-les-dossiers-svn-sous-windows/
Ignore specific subfolders in .htaccess (URL rewrite)'''Method 1 :'''
{{{
RewriteEngine on
#
# stuff to let through (ignore)
RewriteCond %{REQUEST_URI} "/folder1/" [OR]
RewriteCond %{REQUEST_URI} "/folder2/"
RewriteRule (.*) $1 [L]
#
}}}
'''Method 2 :'''
{{{
RewriteEngine On
RewriteBase /
Rewritecond %{REQUEST_URI} !^/linea21/.*$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
}}}
(Ignore rules for ''linea21'' sub-folder)
Updated by Simon over 14 years ago · 3 revisions