Bogiecom.com
  • About
  • Magento
  • Sitecore
  • WordPress

Cleaning Tortoise SVN repo folder of all Dreamweaver _notes folders

Posted on May 11, 2012 by bc-admin

Recursively removing directories and/or files is always quicker this way! This particulary instance I needed to clean out the notes folder from an subversion repository (not necessarily necessary, but this can be applied wherever).

1
C:\Users\SloshDev> gci -include _notes -Recurse | %{ ri $_.FullName -recurse }

or you could…

1
C:\Users\SloshDev> Get-ChildItem -include _notes -Recurse | %{ remove-item $_.FullName -recurse }

Posted in Uncategorized | Leave a comment |

Virtual Host Info from the Shell

Posted on May 10, 2012 by bc-admin

Quick way to get all of the ServerName’s values from the Apache configuration? Especially useful if VirtualHosts have been split into multiple files:

1
cat *.conf | egrep "ServerName (.*)" | sed "s/ServerName\s\(.*\)/\1/"

Posted in Apache Configuration, Bash, Grep, Sed, Shell Scripting | Leave a comment |

Find String in Files with Given Extension Using PowerShell

Posted on May 10, 2012 by bc-admin

Steve Smith, Founder of NimblePros, Speaker, Author, and Software Craftsman. Microsoft MVP and Regional Director. Gives a great example on Recursively locating files with particular text strings and a given extension in PowerShell.
Find String in Files with Given Extension Using PowerShell

Posted in Files, Powershell, Strings | Leave a comment |

Imagick Powershell Resize Images In Folder

Posted on November 18, 2011 by bc-admin

Here’s a quick one-liner to re-size photos if you have Imagick installed using PowerShell. It also renames the files with the dimensions specified:

1
2
PS C:\Users\SloshDev> gci("*.jpg") |
      %{convert  $_.FullName -resize 500x500 $_.Name -replace '\.jpg$','-500x500.jpg'}

Ultimately ended up with this to rename the file based on the actual dimensions of the file in the end:

1
2
PS C:\Users\SloshDev> gci("*.jpg") |
   %{convert $_.FullName -resize 500x500 -set filename:area '%wx%h' ($destination + ($_.Name.Trim("\.jpg") + "-%[filename:area].jpg"))}

This is great if you want to do this within the file itself, however if you need to specify dimensions, source and destination directories, and specific image file extensions you could use a script like this:

1
2
3
4
5
6
7
$source = 'C:\User\SloshDev\My Pictures\'
     $destination = 'C:\User\SloshDev\My Pictures\500's\'
     $ext = "jpg"
     $size = "500x500"
     #Resize Images
      gci("$source*.$ext") |
        %{convert $_.FullName -resize $size -set filename:area '%wx%h' ($destination + ($_.Name.Trim("\.$ext") + "-%[filename:area]." + $ext))}

Posted in Image Resizing, Imagick, Powershell | Leave a comment |

Append Extension to All Files in Directory

Posted on November 11, 2011 by bc-admin

IIS 6.0 did not save configuration files with “.xml” extension automatically. So I needed to add the .xml to the files. So this is what I did:

1
PS C:\_old-IIS-site-configurations> Get-ChildItem *.com | Rename-Item -NewName { $_.Name + ".xml"; }

Nice, quick one-liner to quickly eliminate what would be a pain otherwise.

Posted in Powershell, Rename-Item | Leave a comment |

Miva Merchant Product Attribute Export – Update Pricing with Powershell

Posted on November 9, 2011 by bc-admin

If you’ve ever wanted a tab delimited list of product attributes and prices to update pricing, here’s one way:

Export product attributes through ‘Utilities > Export Data > Export Attributes to XML File’

  1. When exporting choose ‘Replace All Mode
  2. You will have to add a root level element around the xml generated by miva and the file:

    1
    2
    PS C:\>$a = Get-Content .\provide.xml
    PS C:\>Set-Content .\provide.xml -value "<products>",$a,"</products>"      

    Now bring in file as xml:

    1
    PS C:\>$xml = [xml] (Get-Content .\provide.xml)

    Run this command to generate a tab delimited list of Product_Code, Code, & Price

    1
    2
    PS C:\>$xml.Products.ProductAttributeOption_Add |
                   foreach { $_.product_code + "`t" + $_.Price } > .\provide-list.txt

    For more information on Powershell’s xml capabilities and how easy it is to use XML with Powershell visit Powershell XML on Code Project

    .

Posted in Miva Merchant 5.5, Powershell, Updating Product Attributes, XML | Leave a comment |

Grooveshark Konami Code

Posted on November 9, 2011 by bc-admin

If you’re a fan of Grooveshark…

Give the Konami Code a try.

Would you like to see what other sites have some Konami effects? Check out Konami Code Sites.

If you use YUI on your site, there’s a built-in event for handling the Konami Code… see YUI Konami Event by Luke Smith

Posted in Grooveshark, Konami Code, Video Games, YUI Konami Event | Leave a comment |

Magento Custom Form Field Validators using Prototype (MySQL Date Format)

Posted on November 9, 2011 by bc-admin

Here I needed to make sure that the user input was formatted correctly for a MySQL database. The javascript calendar code was set to automatically input the date into the text field in the correct format, but the user still had the option to type it in manually. This was the Prototype validator I used to verify that the user had entered it correctly as ‘YYYY-MM-DD’:

1
2
3
4
5
<script type="text/javascript">
  Validation.add('required-date-format','Please Enter date as YYYY-MM-DD. Click the calendar icon to select a date.', function(v) {
       return  !Validation.get('IsEmpty').test(v) && /^([0-9]{2,4})-([0-1][0-9])-([0-3][0-9])$/.test(v);  });
       var warrantyregistrationForm = new VarienForm('warrantyregistrationForm', true);
</script>

Posted in Custom Field Validator, Date Format, Magento, MySQL | Leave a comment |

Check out this great MSN Video: Air Force to launch ‘mini’ shuttle

Posted on March 20, 2010 by bc-admin

Air Force to launch ‘mini’ shuttle
March 19: Air Force is ready to test the X-37, a new “mini” shuttle, without a crew. WESH’s Dan Billow reports.

Posted in Air Force, Mini Shuttle, X-37 | Leave a comment |

Is It Time for the Web to Abandon Flash? – PCWorld Business Center

Posted on February 4, 2010 by bc-admin

By Tony Bradley

The public battle between Adobe and Apple over bringing Flash to the iPhone, and now iPad, platforms has heated up the debate over the life expectancy of Flash as newer technologies, specifically the emerging HTML5 standard, enter the scene.

Adobe Flash helped to fill a void for a cross-platform multimedia experience on the Web. With the glaring exception of the iPhone and upcoming iPad, Flash can be found on virtually every other operating system–desktop and mobile, and for every Web browser….

Read Entire Article on PCWorld Business Center

Posted in Uncategorized | Leave a comment |
« Previous Page
Next Page »

Pages

  • About
  • Magento
  • Sitecore
  • WordPress

Archives

  • January 2017
  • December 2013
  • November 2013
  • February 2013
  • January 2013
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • November 2011
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • September 2009

Categories

  • .NET
  • Air Force
  • Apache Configuration
  • Bash
  • C#
  • Comma-Delimited
  • Custom Field Validator
  • Date Format
  • Dump Files
  • Files
  • Grep
  • Grooveshark
  • HTML
  • Image Resizing
  • Imagick
  • Integration
  • jQuery
  • Konami Code
  • Linux
  • Magento
  • Magento Third Party CMS Integration
  • Mini Shuttle
  • Miva Merchant 5.5
  • MySQL
  • PHP
  • Powershell
  • Regular Expressions
  • Rename-Item
  • Sed
  • Shell Scripting
  • Sitecore
  • Strings
  • Uncategorized
  • Updating Product Attributes
  • Video Games
  • Wordpress
  • X-37
  • XML
  • YUI Konami Event

CyberChimps WordPress Themes

© 2008 - 2016 Bogiecom.com