25 Dec, 2024

How to lock the orientation to portrait mode in a iPhone/Andorid Web Application?

You can specify CSS styles based on viewport orientation: Target the browser with body[orient=”landscape”]  or body[orient=”portrait”] Try this via the CSS @viewport rule @viewport { orientation: portrait; } Or $(document).ready(function () { $(window) .bind(‘orientationchange’, function(){ if (window.orientation % 180 == 0){ $(document.body).css(“-webkit-transform-origin”, “”) .css(“-webkit-transform”, “”); } else { if ( window.orientation > 0) { //clockwise […]

Share your Love
1 min read

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 […]

Share your Love
1 min read

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” />

Share your Love
1 min read

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 […]

Share your Love
1 min read

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 […]

Share your Love
1 min read

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 […]

Share your Love
2 mins read

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 […]

Share your Love
4 mins read

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 […]

Share your Love
3 mins read

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 […]

Share your Love
1 min read