• Home
  • About
  • Archives
  • Projects
  • Lifestream
  • Contact

Nischalmaniar.info

  • Load twitter updates faster

    Most of the personal blogs these days have twitter feeds. One of the bottleneck while loading the page in the site is Twitter, since it takes time to load the tweets. There is a technique that I have used for my site which can be handy in loading the twitter feeds fast. Basically, I have used cookies to store my twitter updates and display the updates by reading the cookies. (Obviously, this won’t work if you have disabled cookies in your browser settings).

    So let’s dive into the code. First I will show you the JavaScript functions I have used to set/read/delete cookie. Create a JavaScript file : “fasttwittter.js” or any name you want.

    Note: I am specifying my cookie expiry in hours. If you want to do that in seconds then remove both the “60″s from the createCookie function and if you want to set it in minutes then remove only one “60″ and if you want to set it for days then multiply below value by 24. i.e seconds*24*60*60*1000.

    function createCookie(name,value,hours) {
    if (hours) {
    var date = new Date();
    date.setTime(date.getTime()+(hours*60*60*1000));
    var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
    }

    function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
    }

    function eraseCookie(name) {
    createCookie(name,"",-1);
    }

    Read More

    1/20/10

    1

  • Mac: Cannot Empty Trash

    How many times you have encountered this message while trying to empty your trash on your Mac :

    “This operation cannot be completed because the item filename.ext is in use”

    and you would go crazy trying to delete it but it wouldn’t unless you restart your system.
    One way to empty trash in this case is:

    1) Drag the file from your Trash bin back to the Desktop.

    2) Launch a Terminal i.e Go to Application -> Utilities -> Terminal and type the following into the terminal window leaving a space after -rf

    cd ~/.Trash && sudo rm -rf

    3) Drag that file you wanted to delete from your Desktop to the terminal window and then press Enter.

    4) It will ask for your Mac password, so enter your password and press Enter. (Note: On terminal window, when you type the password, you won’t be able to see it, but the password is being entered. So don’t panic).

    If you followed the steps correctly, then the trash will be emptied.

    5/9/09

    5

  • Simple steps to optimize your PC

    Our personal computers are like fine automobiles—they need preventive maintenance to run efficiently and avoid major breakdowns.

    The following tips can help improve your computer’s performance. These examples use Microsoft Windows XP. Some of the screens may differ from version to version, but overall you’ll find these tips work for all versions of Windows, including Windows 95, Windows 98, Windows Millennium Edition (Me), Windows NT, Windows 2000, Windows XP, and Windows Vista.

    By the way, in no way can you blow up your computer or files with any of these procedures. These tasks use utilities provided within the Windows operating systems to aid you in achieving the best system performance. This article does not address tinkering with the registry files.

    Read More

    3/19/09

    2

  • Landscape Painting

    This is my latest landscape painting. I will be glad to recieve your comments and suggestions about it

    Click the image for larger view

    3/7/09

    15

  • 11 Ways to optimize your MAC

    Every now and then, my Macs begin to feel a little sluggish. There are many potential reasons why: I tend to run 8-10 applications all the time – and sometimes push 15 or more. This alone will bog down any Mac.
    At other times, I realize that it’s been weeks since I restarted the computer, and a simple restart will solve a lot of these woes.
    When those don’t speed things up, I’ve found a number of things I can do to encourage my Macs back to their youthful snappiness. Here are a few tips I’ve found for restoring my Macs to full speed without spending a penny.

    Read More

    3/7/09

    1

© Copyright 2007-09 Nischal Maniar

Theme powered by wordpress. Designed and Developed by Nischal Maniar