Troy Thompson

Web Developer

Archive for the ‘tip’ Tag

  1. Howto Create a hotkey to commit in Subclipse

    Published
    Tagged
    Content

    I use Subclipse as a plugin for Eclipse / Aptana, and there is no hotkey to perform a commit. This means anytime you want to commit something you have to navigate the file tree and then the context menus to commit, I'd rather not leave the keyboard to do a commit.

    So after some digging around I figured out how to add a hotkey, and I wanted to share.

    Open Eclipse / Aptana

    Window > Preferences

    In the filter box, type "keys"

    Scroll to "Save All" and double click it.

    In the Command field set change the Category to "SVN"

    Change the Name to "&Commit..."

    Change the key sequence to the key combo you want to perform a commit. I use alt + shift + s, but that might be weird for some folks.

    Click Add

    If you were successful you should be able to use your key combo to perform a commit for now on.

  2. Easy File Transfer from Linux SSH Session to Windows box

    Published
    Tagged
    Content

    This is a short tip to show you how to transfer a file on a linux box to a windows box.

    1. First put FileZilla on the windows box, and create a user with a home directory, open port 21 if behind a firewall, and whitelist FileZilla in the windows firewall.
    2. SSH to the linux box, then navigate to the folder where your file is located.
    3. Type "ftp YOURIP", it will then prompt you for the user and password. See notes for help getting ip address.
    4. Then type "put YOURFILE.EXT" ... see notes for more commands
    5. Now the file should transfer to your windows box.
    6. When its finished just type 'bye' and hit enter and the connection will be closed.

    Notes:
    List of FTP Commands

    You can get your ip from the following:

  3. Remove Link Outlines with CSS and jQuery

    Published
    Tagged
    Content
    1. Add a on click event to the links to blur them.
      $('#nav a').click(function(){$(this).blur(); });
    2. Add outline none to CSS
      #nav a { outline:none; }
    3. Profit

    Note: Adding CSS "outline:none;" to links will make it impossible for keyboard only users to navigate the site, be sure to offer an alternative.

  4. WordPress DST Fix

    Published
    Tagged
    Content

    I noticed WordPress does not automatically compensate for daylight savings time.

    I fixed it by putting the following in my functions.php in my theme.

    <?php
    define('TZ','America/New_York');
    function get_gmt_offset()
    {
      putenv('TZ='.TZ);
      return intval(strftime('%z', time()))/100;
    }
    add_filter('option_gmt_offset','get_gmt_offset');
    ?>

    List of Supported timezones.

    (more...)

  5. Quick Access to Bookmarks using Keywords

    Published
    Last Updated
    Nov 02 2007
    Tagged
    Content

    As a developer I constantly find myself referring to documentation over and over. I recently discovered that you can alias bookmarks in Firefox using the keywords field.

    For example, if I type "rtm" in the address bar and hit enter, Firefox will expand it to http://www.rememberthemilk.com/

    This can be useful for the following:

    (more...)