Seller Discogs RSS feed

I don’t know why was so hard to find an anwser for this.

Just do this:

http://www.discogs.com/seller/[seller_username]?output=rss

Where obviously you must replace the [seller_username] with a seller username (and yes, with no brackets).

Posted in Discogs | Tagged , , , , | Leave a comment

Using div as a site wrapper with HTML5

Short answer: yes.

Sometimes just using <body> as a wrapper isn’t enough and using a <section> into a <section> is semantically incorrect. Sounds like <div> is an option, but is semantically right?

The HTML5 specification page in W3C adds the following note about the <section> element:

The section element is not a generic container element. When an element is needed only for styling purposes or as a convenience for scripting, authors are encouraged to use the div element instead. A general rule is that the section element is appropriate only if the element’s contents would be listed explicitly in the document’s outline.

In the other hand, about the <div> element the HTML specification explains:

The div element has no special meaning at all. It represents its children.

Then adds the following note:

Authors are strongly encouraged to view the div element as an element of last resort, for when no other element is suitable. Use of more appropriate elements instead of the div element leads to better accessibility for readers and easier maintainability for authors.

Basic example

<body>
   <div id="wrapper">
      <section>
      Bla bla bla...
      </section>
   </div>
</body>
Posted in HTML5 | Tagged , , , , , | Leave a comment

Costa Rica Currency Exchange Rate

If you are a web developer for costarican business is highly possible that you have been already requested to include the exchange rate in the page for conversion from 1 USD to Costa Rica colons.

With this simple code you can include the official reference Central Bank of Costa Rica exchange rate for USD directly from their web service and updated daily.

You have 3 options to choose at your convenience:

Posted in How to's, Joomla, Modules, PHP, Web development, Widgets, WordPress | Tagged , , , , , , | Leave a comment

Awesome CSS table designs

Tables are the hell of web design.

Decide on colors, shapes, typography, padding, borders… how to combine it to please the eye of the user that includes all that boring detailed table information.

I have been sailing the seas of tables (ok… that sounds odd) and seems that the secret is on the details that will make that table different. I mean is not about make everything different in all tables, but to make one or two of the standard variables elegant and vivid.

Smooth Taste

Smooth Taste: Preview this table here. In the same page you will find a wide collection of table designs with the stylesheet files. Includes pretty cool and really awful options. Choose wisely.

Sportbooks site designs think in beautiful tables

Sportbook sites are very competitive and they need to use tables to display the odds. Two good examples: sportsbooks.com and Jazz Casino & Sportsbook.

See each example here: Sportsbook.com and Jazz Casino & Sports

Crazy Egg

Crazy Egg tables are one of the best examples when I say that the secret is on details. See how beautiful and elegant these tables are.

Ustream Pricing Table

UStream pricing tables are another good example of how detail makes the difference. If you see this example and the other one of Crazy Egg you will notice the importance of details specially on the table headers.

Are My Sites Up?

Are My Sites Up? uses this table enriched with color differentiation and the use of icons

Waoo!

Table as web applications is the case of Waoo! where animated bandwidth comparison graphic examples are shown.

Posted in CSS, Web design | Leave a comment

How to open an image in the same product page of Magento

Note: This has been tested on Magento 1.4.2.0

No popup window with the image nor the single image alone in the same page.

If you want to replace the large image with the image displayed in the thumbnail when these are clicked, here are the steps to do it:

  1. Edit the file media.phtml that you will find in app/design/frontend/[YOUR TEMPLATE]/default/template/catalog/product/view/
  2. In the final line add a new one and copy/paste the following code:
    <script type="text/javascript">
    function imageReplace(newimageURL){
        document.getElementById("pimage").setAttribute('src', newimageURL);
        document.getElementById("pimage").style.width = '100%';
    }
    </script>
             
  3. Approximately, on line 62 you will find the following code:
    $_img = '<img src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(425).'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'"/>';
    

    Simply add id=”pimage” to the img tag or if preferred replace the whole as follows:

    $_img = '<img src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(425).'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" id="pimage" />';
    
  4. Approximately, on line 73 you will need to change the onclick action of the a href to call the new javascript function that we added in the step 2.
    Replace:

    <a href="#" onclick="imageReplace('<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile()); ?>')" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>">
                    <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(56); ?>" width="56" height="56" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" />
    	        </a>
    

    With:

    <a href="#" onclick="popWin('<?php echo $this->getGalleryUrl($_image) ?>', 'gallery', 'width=300,height=300,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes'); return false;" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"><img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(56); ?>" width="56" height="56" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" /></a>
    

Temgra’s Color All

If you are using Temgra’s Color All with Magento, the solution that you are requiring is a bit different.

  1. Edit the file media.phtml that you will find in app/design/frontend/[YOUR TEMPLATE]/default/template/colorall/
  2. Approximately, on line 54:
                  <a href="#" onclick="popWin('<?php echo $this->getGalleryUrl($_image) ?>', 'gallery', 'width=300,height=300,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes'); return false;" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"><img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(56); ?>" width="56" height="56" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" /></a>
                 

    Replace it with:

                  <a href="#" onclick="imageReplace('<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile()); ?>')" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"><img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(56); ?>" width="56" height="56" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" /></a>
                 
  3. In the final line add a new one and copy/paste the following code:
    <script type="text/javascript">
    function imageReplace(newimageURL){
        document.getElementById("image").setAttribute('src', newimageURL);
    }
    </script>
             
Posted in Color All, How to's, Magento | 5 Comments

Special Character Converter to HTML tool (scc2html)

If you work with multi-language content when coding pages or web based applications you probably are familiarized with the considerations on special character use.

Choosing between use of HTML entities or raw UTF-8 characters will depend of the final user requirements and the limitations of the developer to edit with the code.

scc2html is a command-line bash script that will change common used special characters to HTML entities. It has been tested on a Mac with Snow Leopard (Darwin Kernel Version 10.8.0) and Debian Linux Lenny 5.5. Basically the only requirement is to have Perl installed.

ssc2html project page

Posted in scc2html, Web development | Tagged , , , , | Leave a comment

How to change the default SSH port in Mac OS X

I made this tutorial using Mac Os X 10.6.8 (Snow Leopard).

In this example, let’s say you want to change the default port 22 to port 2222

  1. Open the terminal window
  2. Enter:
    sudo nano /etc/services
  3. Enter the root password, it will open the ‘services’ file. Be careful to avoid modify anything else.
  4. Press CTRL+W and search “ssh”.
  5. You will find to lines assigned to port 22. Something like this:
    ssh 22/udp # SSH Remote Login Protocol
    ssh 22/tcp # SSH Remote Login Protocol

    Change the number 22 in both cases to 2222 or whaterver the port you want to use. Press CTRL+X and then enter ‘Y’ to accept saving the file.

  6. Now we need to restart SSH. Enter the following command to stop it:
    sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
  7. Now enter the following command to start SSH again:
    sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
  8. That’s it, you must be ready to go. You can verify if is working by trying to access locally, just enter:
    ssh localhost -p 2222
Posted in How to's | Tagged , , , | 3 Comments