2013
How to display image with javascript?
You could make use of the Javascript DOM API. In particular, look at the createElement() method. You could create a re-usable function that will create an image like so… function show_image(src, width, height, alt) { var img = document.createElement(“img”); img.src = src; img.width = width; img.height = height; img.alt = alt; // This next line […]
How to print content of JavaScript object?
Print content of object you can use console.log(obj_str); you can see the result in console like below. Object {description: “test”} For open console press F12 in chrome browser, you will found console tab in debug mode.
Joomla Changing the site favicon
The file you created in this way will have the extension .ico. Copy the file to the /joomla/templates/<your template> directory andname it favicon.ico. My favicon is in another location <link rel=”shortcut icon” href=”http://yoursite.com/templates/your_template/icon/favicon.ico” />
Read file in Node.js
Asynchronously reads the entire contents of a file. var fs = require(‘fs’); var path = require(‘path’); exports.testDir = path.dirname(__filename); exports.fixturesDir = path.join(exports.testDir, ‘fixtures’); exports.libDir = path.join(exports.testDir, ‘../lib’); exports.tmpDir = path.join(exports.testDir, ‘tmp’); exports.PORT = +process.env.NODE_COMMON_PORT || 12346; // Read File fs.readFile(exports.tmpDir+’/world.csv’, ‘utf-8’, function(err, content) { if (err) { got_error = true; } else { console.log(‘cat returned […]
Magento site down due to mysql error General error: 1030 Got error -1 from storage engine
This error is generated when InnoDB cannot write to its data files. I have seen reports of this when the disk is full. if the files or folder permission changed so you can’t write to them. try deleting the folders var/cache and var/session. Another report was when someone enabled innodb_force_recovery to a value greater than […]
Creating File Links in Ubuntu: Simplify File Organization and Access
Efficiently linking files in Ubuntu allows for seamless file organization and easy access. This article provides a comprehensive guide on creating links between files, covering both symbolic links and hard links. By implementing these techniques, you can streamline your file management process and enhance productivity in the Ubuntu operating system. Symbolic links, also known as […]
To improve page load times and save bandwidth using the .htaccess
Improving page load times and saving bandwidth are crucial factors for a successful website. The .htaccess file, used by the Apache web server, can be a powerful tool in achieving these goals. In this article, we will explore various techniques and optimizations that can be implemented through the .htaccess file to enhance website performance. One […]
How to Leverage Browser Caching via .htaccess
Leveraging browser caching through the .htaccess file is an effective way to improve website performance by instructing the user’s browser to cache static resources. This reduces the number of requests made to the server, as the browser can retrieve cached files instead. To leverage browser caching, follow these steps: Open your preferred text editor and […]
how can I add comments to a batch file?
The REM statement This is the most common way to write comments. Any line in your bat-file that starts with REM is completely ignored by the command-processor. REM This bat-file moves all files in C:Incoming to C:ToProcess REM Written by Nikunj Kansara REM 05/01/2003 Double Colons Alternatively you can replace the word REM by two […]
How to display HTML tags as plain text in browser using php
Show HTML tags in browser we can use htmlspecialchars() <?php $new = htmlspecialchars(“<a href=’test’>Test</a>”, ENT_QUOTES); echo $new; // <a href='test'>Test</a> ?>