
Hello! My name is Nack Athens. I am a Web Developer/Designer who has been in Photography since 1999.
I live in Seattle, WA but I originally came from Phnom Penh Cambodia.
Specialties
Linux, Apache, MySQL, PHP, C#, Java, XHTML / HTML, CSS, JavaScript, JQuery, AJAX, Database Design, MVC (Model View Controller)
I’m happy to answer any question you might have, and you can get in contact via the contact form on this site.
Life should be fun. If not, fix it!
{Yii} How to register Jquery UI – js and css
With Yii 1.1.4, Jquery UI became part of Yii core. To activate JQuery UI, add the following line to your page: Yii::app()->getClientScript()->registerCoreScript( 'jquery.ui' ); If you want a custom style, download a JQuery UI css and add the following line: Yii::app()->getClientScript()->registerCssFile('LINK_TO_YOUR_CSS_FILE'); To use the style sheet that is already shipped with Yii, add the following line: Yii::app()->clientScript->registerCssFile( Yii::app()->clientScript->getCoreScriptUrl().'/jui/css/base/jquery-ui.css');
List open ports and listening services
Command to list all open ports and listening services: netstat -lnptu The output should look something like this: Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 2458/cupsd tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 2353/postgres tcp6 0 0 :::22 :::* LISTEN 2335/sshd udp 0 0 0.0.0.0:631 0.0.0.0:* 2458/cupsd …
Get URL parameters using jQuery
jQuery code snippet to get the dynamic variables stored in the url as parameters and store them as JavaScript variables ready for use with your scripts. $.urlParam = function(name){ var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href); return results[1] || 0; } // example.com?param1=name¶m2=&id=6 $.urlParam('param1'); // name $.urlParam('id'); // 6 $.urlParam('param2'); // null //example params with spaces http://www.example.com?city=Gold Coast …
Installing or Enabling PDO
Benefits of PDO: Support for prepared statements; Object-oriented interface; Data access abstraction; and Produces cleaner code because you can escape multiple values at once PDO comes with PHP 5.1 and up by default. If you don’t have it on your server, try to install using pecl install pdo If it is already installed try edit /etc/php.ini Add this line ; …
Backup Site Contents from Command Lines
I often manually backup my website by compressing the contents. There are folders that I don’t need to backup. There are many ways to do this, but I thought the way I do it is the simplest way. I create a .txt file to list all the files and folders I do not wish to backup. I call it exclude.txt. …
To Open Port 443 on Linux Server
iptables -A INPUT -p tcp -m state –state NEW -m tcp –dport 443 -j ACCEPT service iptables save service iptables restart
Nifty PHP Coding Tutorials
Below are some tutorials on PHP commonly used functions Limit Characters From Your Text In this tutorial you will learn how to limit characters from a sentence without cutting words up. This is a really useful tutorial. http://www.jooria.com/Limit-Characters-From-Your-Text-a139.html foreach (explode(' ', $str) as $word) { $part = (($sub != '') ? ' ' : '') . $word; $sub .= $part; …
Swapping Column Values in MySQL
To swap values between columns x and y, perform the following MySQL command: UPDATE swap_test SET x=(@temp:=x), x = y, y = @temp;