All snippets of the tag system |
|
1-6 of 6 Entries |
|
|
runPhpCode (PHP::Function) |
Created by Marko Schulz at 2010-02-08 16:51:34 |
/**********************************************
* This function execute PHP code inside in a
* function block.
*
* @param $input The php code to execute
* @return string
*/
function runPhpCode( $input = Null ) {
ob_start();
eval( $input );... |
|
include_path (PHP::Snippets) |
Created by Marko Schulz at 2010-01-20 12:49:23 |
// define base directory from SCRIPT_FILENAME...
$basedir = dirname( $_SERVER['SCRIPT_FILENAME'] ) or
die ("<code>ERROR: Can't detect \$basedir from \$_SERVER['SCRIPT_FILENAME']!</code>");
// upgrade the include path...
ini_set( "incl... |
|
libdir (Python::Snippets) |
Created by Marko Schulz at 2008-12-27 04:02:23 |
import os, sys
# Get the script directory.
scriptdir = os.path.abspath( os.path.dirname( sys.argv[0] ) )
# Expant the python path for config and library directory.
sys.path[1:2] = ( scriptdir + os.sep + 'etc', scriptdir + os.sep + 'lib' ) |
|
libdir (Perl::Snippets) |
Created by Marko Schulz at 2008-12-27 03:44:26 |
BEGIN {
my $prefix = $ENV{'HOME'}."/bin/perl";
my $libdir = ${prefix}."/lib";
unshift(@INC, $libdir);
}
# Display all package paths:
print $_."\n" foreach (@INC); |
|
sleep (Perl::Snippets) |
Created by Marko Schulz at 2008-12-27 03:36:30 |
# Time to wait in milliseconds (0.25 => 250)
my $waiting = 0.25;
while (1) {
print "Hallo World!\n";
# sleep of $waiting milliseconds
select( undef, undef, undef, $waiting );
} |
|
hostname (Python::Function) |
Created by Marko Schulz at 2008-12-27 02:51:30 |
def hostname():
"""hostname --- Return the hostname of the current maschine.
(string) string hostname()"""
from os import popen
return popen('hostname').read().rstrip() |
|
1-6 of 6 Entries |
|
|