<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Web Design &#187; script</title> <atom:link href="http://patjack.co.uk/tag/script/feed/" rel="self" type="application/rss+xml" /><link>http://patjack.co.uk</link> <description>Patrick Robertson</description> <lastBuildDate>Sat, 04 Feb 2012 12:39:25 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Batch compress all files in a folder with YUI Compressor</title><link>http://patjack.co.uk/batch-compress-all-files-in-a-folder-with-yui-compressor/</link> <comments>http://patjack.co.uk/batch-compress-all-files-in-a-folder-with-yui-compressor/#comments</comments> <pubDate>Mon, 24 May 2010 16:07:51 +0000</pubDate> <dc:creator>Patrick</dc:creator> <category><![CDATA[SEO]]></category> <category><![CDATA[Web Design]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[compress]]></category> <category><![CDATA[css]]></category> <category><![CDATA[google]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[script]]></category> <category><![CDATA[terminal]]></category><guid
isPermaLink="false">http://patjack.co.uk/?p=413</guid> <description><![CDATA[I&#8217;ve recently read up on the importance of site performance for search engine optimisation (SEO). Google is saying that this year (2010) it may start using the speed your site loads as a factor in determining where your site shows up in its results list. One great way of decreasing the load times of your [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve recently read up on the importance of site performance for search engine optimisation (SEO).</p><p>Google is saying that this year (2010) it may start using the speed your site loads as a factor in determining where your site shows up in its results list.</p><p>One great way of decreasing the load times of your site is to compress the CSS and Javascript.<br
/> <span
id="more-413"></span><br
/> Before&#8230;<br
/> <img
src="http://patjack.co.uk/wp/wp-content/uploads/2010/05/uncompressed-300x137.png" alt="Uncompressed Javascript File" title="Uncompressed Javascript File" width="300" height="137" class="aligncenter size-medium wp-image-415" /><br
/> After&#8230;<br
/> <img
src="http://patjack.co.uk/wp/wp-content/uploads/2010/05/compressed-300x62.png" alt="Compressed Javascript File" title="Compressed Javascript File" width="300" height="62" class="aligncenter size-medium wp-image-417" /></a></p><p>There are several methods out there, but Yahoo&#8217;s YUI Compressor is supposed to be the best.<br
/> The compressor is a java (.jar) file that you need to run from the command prompt or terminal. The biggest flaw in it&#8217;s design is that you can only compress one file at a time.</p><p>Here comes the solution!</p><p>I&#8217;ve created a small bash script (.sh) that you can double click to convert all the javascript / css files in a folder (and all folders recursively)</p><p>here it is:<br
/> <code><br
/> #!/bin/sh<br
/> for file in `find . -name "*.js"`<br
/> do<br
/> echo "Compressing $file …"<br
/> java -jar min.jar --type js -o $file $file<br
/> done<br
/> </code></p><p>The file&#8217;s pretty self explanatory; it finds all the files ending in .js (you can change this to .css for CSS files) and performs the compress action on each file.</p><p>To get this to work, you must make the script executable (download mine at the end of this post) and have the YUI Compressor file in the same directory as the batch.sh script (note that it needs to be called min.jar)</p><p>From terminal, you just need to go to the directory with the javascript files in and type<br
/> <code>./batch.sh</code><br
/> to run the script.<br
/> <img
src="http://patjack.co.uk/wp/wp-content/uploads/2010/05/processing.png" alt="YUI Compressor compressing javascript files in a folder" title="YUI Compressor compressing javascript files in a folder" width="550px" class="alignnone size-full wp-image-420" /></p><p>et voila!</p><h3 style="color:#ff6600">Update &#8211; an ever better option</h3><p>If you put the batch.sh file in your /usr/local/bin folder then you&#8217;ll be able to use the command anywhere from within terminal (it must be chmodded a+x) I&#8217;ve made a file called &#8216;yuicompress&#8217; which means, if placed in the /usr/local/bin folder (you need root access) you can type &#8216;yuicompress&#8217; in terminal to get the command to work!</p><p>Type<br
/> <code><br
/> yuicompress arg<br
/> </code><br
/> where arg is either &#8216;css&#8217; or &#8216;js&#8217; (no quotes) to compress CSS or JavaScript respectively.<br
/> The one thing you need to do with this new script is place the min.jar (or compressor.jar as I&#8217;ve renamed it) in a global place. I chose ~/Library/Application Support/YUICompressor/compressor.jar</p><p>Download the files below and place the yuicompress in /usr/local/bin, and the YUICompress folder in ~/Library/Application Support/YUICompressor/compressor.jar to get this to work from any older on your Mac/Unix box <img
src='http://patjack.co.uk/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>Downloads:<br
/> Script: <a
href="http://patjack.co.uk/files/batch.sh">Batch Convert for YUI Compressor</a><br
/> YUI Compressor: <a
href="http://patjack.co.uk/files/min.jar">YUI Compressor .jar file</a><br
/> Chmodded yuicompress script &amp; YUICompressor folder: <a
href=&#8221;http://patjack.co.uk/files/yuicompress.zip</p> ]]></content:encoded> <wfw:commentRss>http://patjack.co.uk/batch-compress-all-files-in-a-folder-with-yui-compressor/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>1Password Plugin for Quicksilver</title><link>http://patjack.co.uk/1password-plugin-for-quicksilver/</link> <comments>http://patjack.co.uk/1password-plugin-for-quicksilver/#comments</comments> <pubDate>Mon, 22 Mar 2010 14:58:00 +0000</pubDate> <dc:creator>Patrick</dc:creator> <category><![CDATA[Apps]]></category> <category><![CDATA[Mac OS X]]></category> <category><![CDATA[1Password]]></category> <category><![CDATA[mac]]></category> <category><![CDATA[os x]]></category> <category><![CDATA[quicksilver]]></category> <category><![CDATA[script]]></category> <category><![CDATA[snow leopard]]></category><guid
isPermaLink="false">http://patjack.co.uk/?p=399</guid> <description><![CDATA[I&#8217;ve recently developed a 1Password plugin for Quicksilver that gives you the ability to open up Go &#38; Fill items in 1Password, as well as giving you an action to &#8216;Go &#38; Fill&#8230;&#8217; directly from Quicksilver. To download this plugin, go over to my Github repository. If you like the plugin then please do donate [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve recently developed a 1Password plugin for Quicksilver that gives you the ability to open up Go &amp; Fill items in 1Password, as well as giving you an action to &#8216;Go &amp; Fill&#8230;&#8217; directly from Quicksilver.</p><p><a
href="http://patjack.co.uk/wp/wp-content/uploads/2010/03/goAndFill.jpg"><img
class="aligncenter size-medium wp-image-401" title="Go And Fill Action" src="http://patjack.co.uk/wp/wp-content/uploads/2010/03/goAndFill-300x185.jpg" alt="Go And Fill Action" width="300" height="185" /></a><br
/> <span
id="more-399"></span></p><p>To download this plugin, go over to my <a
href="http://github.com/pjrobertson/1Password-Plugin">Github repository</a>.</p><p>If you like the plugin then please do donate to the project &#8211; but note that this isn&#8217;t for the work I&#8217;ve done on Quicksilver itself, just the 1Password plugin.</p><p>If there&#8217;s something missing from the plugin, or you&#8217;ve found a bug then let me know &#8211; although do read the README first over at Github.</p><div
style="text-align: right; margin-top: -20px;"><form
action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input
type="hidden" name="cmd" value="_donations"> <input
type="hidden" name="business" value="7MJHCZAQF5KEU"> <input
type="hidden" name="lc" value="GB"> <input
type="hidden" name="item_name" value="Quicksilver 1Password Plugin"> <input
type="hidden" name="currency_code" value="USD"> <input
type="hidden" name="bn" value="PP-DonationsBF:btn_donate_LG.gif:NonHosted"> <input
type="image" src="https://www.paypal.com/en_GB/i/btn/btn_donate_LG.gif" style="border:none;background:none;" name="submit" alt="PayPal - The safer, easier way to pay online."> <img
alt="Donate to Quicksilver 1Password Plugin" style="border:none;" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1"><br
/></form></div> ]]></content:encoded> <wfw:commentRss>http://patjack.co.uk/1password-plugin-for-quicksilver/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Toggle Keyboard Viewer in Snow Leopard 10.6</title><link>http://patjack.co.uk/toggle-keyboard-viewer-in-snow-leopard-10-6/</link> <comments>http://patjack.co.uk/toggle-keyboard-viewer-in-snow-leopard-10-6/#comments</comments> <pubDate>Thu, 10 Dec 2009 10:50:47 +0000</pubDate> <dc:creator>Patrick</dc:creator> <category><![CDATA[Mac OS X]]></category> <category><![CDATA[applescript]]></category> <category><![CDATA[mac]]></category> <category><![CDATA[os x]]></category> <category><![CDATA[quicksilver]]></category> <category><![CDATA[script]]></category> <category><![CDATA[snow leopard]]></category><guid
isPermaLink="false">http://patjack.co.uk/?p=296</guid> <description><![CDATA[Ever since upgrading to Snow Leopard, one function I&#8217;ve missed is the ability to toggle the Keyboard Viewer on and off with an applescript. It looks like Apple modified the Keyboard Viewer utility for Mac OS X 10.6 (or a possible tablet, who knows&#8230;) and the old applescripts don&#8217;t work. I&#8217;ve finally come across a [...]]]></description> <content:encoded><![CDATA[<p>Ever since upgrading to Snow Leopard, one function I&#8217;ve missed is the ability to toggle the Keyboard Viewer on and off with an applescript.<br
/> It looks like Apple modified the Keyboard Viewer utility for Mac OS X 10.6 (or a possible tablet, who knows&#8230;) and the old applescripts don&#8217;t work.<br
/> <img
src="http://patjack.co.uk/wp/wp-content/uploads/2009/12/keyboard_veiwer-1024x437.jpg" alt="" title="keyboard_veiwer" width="512" height="219" class="aligncenter size-large wp-image-370" /><br
/> I&#8217;ve finally come across a method for getting this to work in Snow Leopard again, although it&#8217;s not as easy as it was in Leopard, and it seems to be as slow as hell to open.<br
/> <span
id="more-296"></span><br
/> Check out Nicholas Riley&#8217;s tiny app (only 6 lines of custom code!) that fixes this:<br
/> <a
href="http://github.com/nriley/keyboardViewer">http://github.com/nriley/keyboardViewer</a> (<a
href="http://cloud.github.com/downloads/nriley/keyboardViewer/keyboardViewer-1.0.zip">download</a>)</p><p>Once that&#8217;s downloaded and installed (you need to go into terminal and move it, or just navigate to /usr/local/bin/ and paste it there), you can then use the applescript listed on the App&#8217;s homepage to get it working in applescript.<br
/> <code><br
/> tell application "System Events"<br
/> if exists (process "Keyboard Viewer") then<br
/> click process "Keyboard Viewer"'s window 1's buttons whose subrole is "AXCloseButton"<br
/> else<br
/> do shell script "/usr/local/bin/keyboardViewer"<br
/> end if<br
/> end tell<br
/> </code></p><p>I have modified this slightly, as the &#8216;click process&#8217; part of the applescript uses a deprecated method (Apple&#8217;s own fault) and could become obsolete at any point. I just used a simple killall command in its place</p><p><code><br
/> tell application "System Events"<br
/> if exists (process "Keyboard Viewer") then<br
/> do shell script "killall KeyboardViewer"<br
/> else<br
/> do shell script "/usr/local/bin/keyboardViewer"<br
/> end if<br
/> end tell<br
/> </code></p><p>And now, my trusty Cmd + Optn + Ctrl + K Quicksilver trigger is back!</p> ]]></content:encoded> <wfw:commentRss>http://patjack.co.uk/toggle-keyboard-viewer-in-snow-leopard-10-6/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)

Served from: patjack.co.uk @ 2012-02-06 05:08:42 -->
