Posts Tagged With: function

Fish Alias/Function Location

Tagged with: , , , , , ,

The alias/function of the fish shell are stored at ‘/home/username/.config/fish/functions’

No Comments »

Creating an Alias in fish shell

Tagged with: , , , , , ,

Fish shell has an easy method to create a command alias…


alias del='rm'
save_function del
No Comments »

A Simple Logging Function for JavaScript

Tagged with: , , , , , ,

Prints all the arguments of the function. This function uses console.log if firebug is available - else, uses alert.


function p() {
                for(var i=0; i<<arguments.length; i++) {
			if(window.console) console.log(arguments[i]);
			else alert(arguments[i]);
		}
}
No Comments »

CSV Export/Import Functions in PHP

Tagged with: , , , ,

Functions to Export and import CSV data using PHP


//*Get the result of the query as a CSV stream.
function CSVExport($query) {
	global $sql;

	$sql_csv = $sql->getSqlHandle($query);

	header("Content-type:text/octect-stream");
	header("Content-Disposition:attachment;filename=data.csv");
	while($row = mysql_fetch_row($sql_csv)) {
		$row = $sql->_stripsls($row);
		print '"' . implode('","',$row) . "\"\n";
	}
	exit;
}

[tags]php,export,import,csv,function[/tags]

3 Comments »