PHP

Format file size in PHP - This function formats a file size. It takes in the number of bytes for the parameter and returns a string with the formated size. function formatFileSize($theSize){
Vailidate and format phone number in PHP - This is a simple function that validates a given phone number and if it is valid it returns it in the form xxxxxxxxxx. function validatePhoneNumber($phonenumber){ if
View more...

Java

TCL/Expect

Automating SSH Logins with Expect - You can use TCL/Expect to automate SSH logins to a remote server to execute a command on that server. The following example will SSH into a server and restart apache. #!/usr/bin/expect
View more...

Perl

Javascript

Ajax callback function - This is a simple AJAX function that executes a callback function when it gets the data from the given URL. The callback function should accept a string parameter function
View more...