Topics

HTML

Replacing URLs in HTML and JS with mod_proxy on apache 2.2

Simple way to replace URLs for proxied websites using mod filter and substitute

<VirtualHost *:80 >
ProxyPreserveHost On
ServerName proxy-test.example.com
FilterDeclare MYFILTER
FilterProvider MYFILTER SUBSTITUTE resp=Content-Type $text/
FilterProvider MYFILTER SUBSTITUTE resp=Content-Type $/xml
FilterProvider MYFILTER SUBSTITUTE resp=Content-Type $/json
FilterProvider MYFILTER SUBSTITUTE resp=Content-Type $/javascript
<Location />
#disable gzip
RequestHeader unset Accept-Encoding
FilterChain MYFILTER
Substitute "s!(images|static|test).example.com!proxy-$1.example.com!i"
</Location>
ProxyPass / http://test.example.com/
ProxyPassReverse / http://test.example.com/
</VirtualHost >
Modify on Gist

Install Sphinx 2.0.4 on CentOS 6.2

– Make sure to check CentOS, PHP-FPM, Nginx, memcached and MYSQL posts.

– Get fresh RPM from sphinxsearch.com

– Install Sphinx

rpm -Uhv http://sphinxsearch.com/files/sphinx-2.0.4-1.rhel6.x86_64.rpm

– Create sample MySQL database

jQuery plugin : monnaTip 0.1

This the simplest tooltip jQuery plugin you can find around.

    features:
  • takes advantage of live(), mouseenter and mouseleave methods
  • tracks mouse movement
  • right and bottom viewport border tracking
  • can be applied on any element

DemodownloadGoogle codeGitHub

use name attribute for input instead of id for use with label

you need Jquery:

<label for="myinput"></label><input name="myinput" type="text" value="text here" />
$('label').live('click', function(e){
        if( $(e.target).is(':input') ) return;
        var i = $(':input[name="' + $(this).attr('for') + '"]')
        i.is(':checkbox') ? i.attr('checked', !i.attr('checked') ) : i.focus().select();
    })

Convert html to vbcode and post to vbulletin

using vbulletin files :

chdir('/path/to/forum');
define('THIS_SCRIPT', 'login');
require_once( './global.php');
require_once( DIR . '/includes/functions_wysiwyg.php' );

echo convert_wysiwyg_html_to_bbcode('<i>hello world</i>');

using external function :