‘Tools’ Category

 

Chrome Extensions: History Button, Extensions Button, Downloads Button

I just created some very simple extensions for Chrome shortly after I taught myself how to create extensions.

As I said, they're VERY simple, but I find them useful, so I figured it wouldn't hurt to share them.

Each extension is a simple lightweight extension that adds a shortcut button to your browser for quick access to your history, extensions, or downloads. It either opens a new tab, or switches to the respective tab if you already have it open in a tab you're not using.

You could nearly accomplish the same thing if you made a bookmark, but this assures you won't open multiple tabs and I like to keep some things separate from the bookmarks bar.

Chrome Extensions Button

Chrome History Button

Chrome Downloads Button

 
 
 

How To Convert Large XML Files to CSV

 I usually struggle with convert very large XML files to other formats just because they are in a dynamic format and most programs you find run out of memory before properly parsing them. Well, I'm happy to say, I found a FAST and EASY solution. Of course this will work for small files as well as big files.

You'll want to grab a copy of the msxsl command line utility from Microsoft.

After you've got that, you'll need to setup a XSL file to tell the program how to format your file. If you're unfamiliar with XSL, you can familiarize yourself here.

After you've got your XSL file created, it's a simple command line entry:

1
msxsl xml_file.xml xsl_file.xsl -o output_file.csv

The following is a sample XML and XSL file that I used.

XML File:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<catalog>
	<content>
		<contentid>772500</contentid>
		<createdate>Tue, 20 Jan 2009 16:28:08 CST</createdate>
		<lastupdatedate>Tue, 20 Jan 2009 16:51:01 CST</lastupdatedate>
 
		<description>
		<artist>
			<id>61951</id>
			<name>The Hills Season 1</name>
		</artist>
	</description></content>
	<content>
		<contentid>773000</contentid>
		<createdate>Tue, 20 Jan 2009 16:28:08 CST</createdate>
		<lastupdatedate>Tue, 20 Jan 2009 16:53:54 CST</lastupdatedate>
 
		<description>
		<artist>
			<id>61926</id>
			<name>Hogan Knows Best Season 2</name>
		</artist>
	</description></content>
	<content>
		<contentid>775500</contentid>
		<createdate>Thu, 22 Jan 2009 14:49:12 CST</createdate>
		<lastupdatedate>Thu, 22 Jan 2009 14:51:35 CST</lastupdatedate>
 
		<description>
		<artist>
			<id>62068</id>
			<name>Carlos Mencia 2007</name>
		</artist>
		<category>
			<id>1402</id>
			<name>Comedy Central</name>
		</category>
	</description></content>
</catalog>

XSL File (Creates tab-delimited file)

1
2
3
4
5
6
7
8
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<xsl:for-each select="catalog/content">
			<xsl:value-of select="title"/><xsl:text>	</xsl:text><xsl:value-of select="artist/name"/><xsl:text>
</xsl:text>
		</xsl:for-each>
	</xsl:template>
</xsl:stylesheet>
 
 
 

HTML Optimizer & Compressor

Quite often I create an HTML file, possibly generated dynamically, that sees a ton of exposure. To save loading time and bandwidth, I optimize/compress the static files (HTML, CSS, and Javascript). I’ve found very good tools for packing Javascript and CSS, Dean Edwards’ packer and CSS Drive’s compressor respectively, but haven’t found a great tool for optimizing HTML. The following tool is something I whipped up in VB.net which simply removes whitespace and comments from HTML and tells you how much disk space you are saving. Careful, it could possibly mess up your javascript or anything else whitespace sensitive (pre tags, etc), but should do the job for most tasks. Admittedly this might be more convenient as a web application, and it wouldn’t take much, but I created it personally for my uses so I can use it offline as well.

Download: HTMLOptimizer.zip (7.92KB)

 
 
 

» Recent Comments

  • Diego: When I've said that "is ...
  • Diego: @ Dan I mainly use...
  • Marcus: Can you make a bookmarks...

» Meta