Categories
Uncategorized

Syntax highlighter plugin for WordPress

http://wordpress.org/extend/plugins/syntaxhighlighter/installation/

Categories
JavaScript

Add a button to ExtJS grid

Categories
PHP Web Development

Get web page content with PHP when you are behind a proxy

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, “http://example.com”);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXY, “proxyname”);
curl_setopt($ch, CURLOPT_PROXYPORT, 8080);
curl_setopt ($ch, CURLOPT_PROXYUSERPWD, “username:password”);
$pageContent = curl_exec($ch);
curl_close($ch);
Categories
Linux

Run BIN files in Linux

> chmod +x application.bin
> ./application.bin

Categories
Linux PHP

Install XDebug on Ubuntu / Debian

More updated info:
http://wylbur.us/2014-06-17-add-xdebug-to-ubuntu-1404

> sudo apt-get install php5-xdebug

> sudo nano /etc/php5/conf.d/xdebug.ini
zend_extension=/usr/lib/php5/20060613+lfs/xdebug.so
xdebug.remote_enable=on
xdebug.remote_handler=dbgp

Or, it can be added to php.ini and extended, like this:

And very important! enable the following options in php.ini:

Categories
ASP.NET

Session State or ViewState?

There are certain cases where holding a state value in ViewState is not the best option. The most commonly used alternative is Session state, which is generally better suited for:

  • Large amounts of data.
    As ViewState increases the size of both the HTML page sent to the browser and the size of form posted back, it’s a poor choice for storing large amounts of data.
  • Sensitive data that is not already displayed in the UI.
    While the ViewState data is encoded and may optionally be encrypted, your data is most secure if it is never sent to the client. So, Session state is a more secure option.
  • Objects not readily serialized into ViewState, for example, DataSet.
    As already discussed the ViewState serializer is optimized for a small set of common object types. Other types that are serializable may be persisted in ViewState, but are slower and can generate a very large ViewState.
  • Author:www.dotnetjohn.com