<?xml version="1.0"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Blog of Zane Ashby</title>
    <link>http://demonastery.org/</link>
    <atom:link href="http://demonastery.org/rss.xml" rel="self" type="application/rss+xml" />
    <description>demonastery.org</description>
    <language>en-us</language>
    <pubDate>Tue, 18 Jun 2013 23:47:12 +1200</pubDate>
    <lastBuildDate>Tue, 18 Jun 2013 23:47:12 +1200</lastBuildDate>

    
      
    <item>
      <title>Idel IRC Client</title>
      <link>http://demonastery.org/2013/06/idel-irc-client/</link>
      <pubDate>Sun, 09 Jun 2013 19:35:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2013/06/idel-irc-client</guid>
      <description>&lt;p&gt;&lt;center&gt;&lt;a href='/images/2013-06-09/idel.png'&gt;&lt;img src='/images/2013-06-09/idel_600x.png' /&gt;&lt;/a&gt;&lt;/center&gt;&lt;/p&gt;

&lt;p&gt;I made an IRC client. In fact for the past few months I&amp;#39;ve been doing a lot of client-side work using &lt;a href=&quot;http://angularjs.org&quot;&gt;AngularJS&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I can&amp;#39;t possibly praise AngularJS enough; this HTML and JavaScript framework from Google has completely changed the way that I write for the web. It&amp;#39;s great for developing rich, responsive interfaces, and has a fantastic community (&lt;code&gt;#AngularJS&lt;/code&gt; on Freenode). Best of all, it&amp;#39;s perfect for writing large testable and maintainable JavaScript apps.&lt;/p&gt;

&lt;p&gt;As a daily user of IRC, I&amp;#39;ve built a ton of bots, and frequently bounce between clients (currently using &lt;a href=&quot;https://github.com/hexchat/hexchat&quot; title=&quot;hexchat/hexchat: GTK+ IRC client&quot;&gt;hexchat&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/5fa6d05f1d097d75b1ae446c5af3c28f?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt; through &lt;a href=&quot;https://github.com/znc/znc&quot; title=&quot;znc/znc: Official repository for the ZNC IRC bouncer&quot;&gt;znc&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/fcceed9e8a6bb96a2fcc36d56a3803f2?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt;). I don&amp;#39;t have any spectacular needs in a client though, so I decided that this would be a cool opportunity to build my own using 100% client-side web technology.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Being evil with narrow-to-region-indirect</title>
      <link>http://demonastery.org/2013/04/emacs-evil-narrow-region/</link>
      <pubDate>Mon, 22 Apr 2013 16:55:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2013/04/emacs-evil-narrow-region</guid>
      <description>&lt;p&gt;Following up on my &lt;a href=&quot;/2013/04/emacs-narrow-to-region-indirect/&quot;&gt;last post&lt;/a&gt;, here is how you can define a custom operator for &lt;code&gt;evil-mode&lt;/code&gt; (which is where the true power of Vim comes into play).&lt;/p&gt;

&lt;p&gt;It is trivially easy to set this up using &lt;code&gt;evil-define-operator&lt;/code&gt;. Here is the code:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;scheme&quot;&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;evil-define-operator&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;evil-narrow-indirect&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;beg&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;&amp;quot;Indirectly narrow the region from BEG to END.&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;interactive&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&amp;lt;R&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;evil-normal-state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;narrow-to-region-indirect&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;beg&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Now all that is left is to bind it to a key! I&amp;#39;m using &lt;code&gt;&amp;quot;m&amp;quot;&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;scheme&quot;&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;define-key&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;evil-normal-state-map&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;m&amp;quot;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;&amp;#39;evil-narrow-indirect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;define-key&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;evil-visual-state-map&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;m&amp;quot;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;&amp;#39;evil-narrow-indirect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Eval all of this, and now we have everything in place to say &lt;code&gt;&amp;quot;mit&amp;quot;&lt;/code&gt; or &lt;code&gt;&amp;quot;mi}&amp;quot;&lt;/code&gt;, etc.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Narrow-to-region-indirect for Emacs</title>
      <link>http://demonastery.org/2013/04/emacs-narrow-to-region-indirect/</link>
      <pubDate>Fri, 19 Apr 2013 01:25:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2013/04/emacs-narrow-to-region-indirect</guid>
      <description>&lt;p&gt;I&amp;#39;m once again an Emacs convert. I used Emacs a fair bit back in 2011 as my main editor (when &lt;code&gt;vimpulse&lt;/code&gt; was a viable alternative to native Vim and I forced Emacs upon myself for as long as I could), I &lt;a href=&quot;http://demonastery.org/2010/10/sawfish-and-emacs-org-mode/&quot;&gt;even&lt;/a&gt; &lt;a href=&quot;http://demonastery.org/2011/07/emacs-tip-vimpulse/&quot;&gt;wrote&lt;/a&gt; a &lt;a href=&quot;http://demonastery.org/2011/05/org-agenda-sms-el/&quot;&gt;few&lt;/a&gt; &lt;a href=&quot;http://demonastery.org/2009/05/automatic-agenda-notification/&quot;&gt;posts&lt;/a&gt; about extending it. But eventually I gave it up as it was starting to feel sluggish with everything I was throwing at it (looking back, it was more than likely just a bad minor-mode or two).&lt;/p&gt;

&lt;p&gt;However in the time I&amp;#39;ve been away from Emacs I feel as though the eco-system has really modernized. We now have &lt;a href=&quot;https://github.com/technomancy/emacs-starter-kit&quot; title=&quot;technomancy/emacs-starter-kit: Because the Emacs defaults are not so great sometimes.&quot;&gt;emacs-starter-kit&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/22788ec68b2aee512f8f4c5d8ae819ae?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt; and &lt;a href=&quot;https://github.com/bbatsov/prelude&quot; title=&quot;bbatsov/prelude: Prelude is an enhanced Emacs 24 configuration that should make your experience with Emacs both more pleasant and more powerful.&quot;&gt;prelude&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/7710f41976a45c0b25deaf0f2a4577bc?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt; to get you up and running quickly with sane defaults, we have &lt;code&gt;package.el&lt;/code&gt; since Emacs 24, along with &lt;a href=&quot;http://melpa.milkbox.net/&quot;&gt;MELPA&lt;/a&gt; as a maintained repository of elisp packages, and even a set of decent color themes! And of course I can&amp;#39;t leave out &lt;a href=&quot;http://emacswiki.org/emacs/Evil&quot;&gt;evil&lt;/a&gt; (the &lt;em&gt;extensible vi layer&lt;/em&gt;) which I could not do without.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Litc, a Literate-style Program Compiler</title>
      <link>http://demonastery.org/2013/03/litc-literate-program-compiler/</link>
      <pubDate>Fri, 01 Mar 2013 15:45:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2013/03/litc-literate-program-compiler</guid>
      <description>&lt;p&gt;&lt;a href=&quot;http://coffeescript.org#literate&quot;&gt;CoffeeScript v1.5.0&lt;/a&gt; was released a few days ago. One of the new features touted in this release was the addition of &amp;quot;Literate CoffeeScript&amp;quot;. This was an additional mode in the compiler that allows it to process files ending with &lt;code&gt;.litcoffee&lt;/code&gt; that contain both Markdown and CoffeeScript together to form a literate program.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Literate_programming&quot;&gt;Literate programming&lt;/a&gt;, introduced by Donald Knuth, is a technique of writing programs in the natural order and style that you would use if you were to verbally describe the way a program works. Literate programming is designed to break the order of source code required by traditional compilers. It can be fun to build programs in this way by simply starting a document with a description and a list of headers for each feature.&lt;/p&gt;

&lt;p&gt;I thought it was really cool to see this in CoffeeScript, but it made me wonder why exactly this needed to be a CoffeeScript extension and not another tool available for any language. So I wrote a small utility to do exactly that.&lt;/p&gt;

&lt;p&gt;There are several utilities out there already for assisting with literate programming, however I have a crazy case of &lt;em&gt;Not Invented Here&lt;/em&gt; so I decided it would be fun to write my own take on the idea.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Hello, Leap World!</title>
      <link>http://demonastery.org/2013/01/hello-leap-world/</link>
      <pubDate>Wed, 23 Jan 2013 00:20:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2013/01/hello-leap-world</guid>
      <description>&lt;p&gt;By now, most people that keep up to date with tech news will have heard about the small $70USD 3D motion sensing controller by &lt;a href=&quot;https://leapmotion.com&quot;&gt;Leap Motion&lt;/a&gt; (make sure to see the demo if you haven&amp;#39;t already) that is claiming to open up some incredible possibilities for the future of computer input.&lt;/p&gt;

&lt;p&gt;In a nutshell, the Leap is a device similar to Microsoft&amp;#39;s Kinect; it uses a pair of infrared cameras and some clever math to build a point cloud and detect hands + fingers + tools inside of this point cloud and return information about these using a simple API. Though where the Leap really excels is in speed and accuracy. This thing is &lt;em&gt;fast&lt;/em&gt;, in my brief test on an i7 CPU and USB3 connection I was seeing between 2-5ms of latency, which is perfect for an input device and quite a feat considering the accuracy, which is right down to the millimeter level.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>WacomWebPlugin PKGBUILD</title>
      <link>http://demonastery.org/2013/01/wacom-web-plugin-pkgbuild/</link>
      <pubDate>Sun, 13 Jan 2013 19:10:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2013/01/wacom-web-plugin-pkgbuild</guid>
      <description>&lt;p&gt;After a short stint of hacking on &lt;a href=&quot;https://github.com/ZaneA/WacomWebPlugin&quot; title=&quot;ZaneA/WacomWebPlugin: An implementation of the Wacom Tablet Plugin for modern browsers on Linux.&quot;&gt;WacomWebPlugin&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/583ce06565a8619dc5caad4b5ebc318a?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt; I&amp;#39;ve tagged the repository as &lt;code&gt;v0.1&lt;/code&gt; and released my first ever &lt;a href=&quot;https://aur.archlinux.org/packages/wacomwebplugin/&quot;&gt;PKGBUILD for ArchLinux&lt;/a&gt;. If you have a Wacom device on Linux then go and try it out!&lt;/p&gt;

&lt;p&gt;Since the last update:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Device id is no longer hardcoded.&lt;/li&gt;
&lt;li&gt;The eraser device is now also used.&lt;/li&gt;
&lt;li&gt;No more phantom presses since we use the proximity events to change the pen type.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All in all the plugin is feeling a lot more stable than before.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>WacomWebPlugin Updated</title>
      <link>http://demonastery.org/2013/01/wacom-web-plugin-updates/</link>
      <pubDate>Tue, 08 Jan 2013 14:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2013/01/wacom-web-plugin-updates</guid>
      <description>&lt;p&gt;Nine months ago, I published &lt;a href=&quot;https://github.com/ZaneA/WacomWebPlugin&quot; title=&quot;ZaneA/WacomWebPlugin: An implementation of the Wacom Tablet Plugin for modern browsers on Linux.&quot;&gt;WacomWebPlugin&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/583ce06565a8619dc5caad4b5ebc318a?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt;, a project aiming to implement the &lt;a href=&quot;http://www.wacomeng.com/web/WebPluginReleaseNotes.htm&quot;&gt;Wacom Tablet Plugin API&lt;/a&gt; on the Linux OS where the official browser plugin isn&amp;#39;t available. The plugin allows websites to make use of tablet features such as pressure-sensitivity. The most well known user of this API is &lt;a href=&quot;http://sta.sh/muro&quot;&gt;DeviantART&amp;#39;s Muro&lt;/a&gt; web app.&lt;/p&gt;

&lt;p&gt;My initial proof-of-concept was hacked together using the &lt;a href=&quot;http://firebreath.org&quot;&gt;FireBreath&lt;/a&gt; framework, which makes it easy to implement cross-platform and cross-browser plugins. I was able to get enough of a plugin working to allow basic pressure-sensitive drawing on Muro. However, the code was crap and was full of repetition and global state. I published it nonetheless.&lt;/p&gt;

&lt;p&gt;Over the last couple of days I&amp;#39;ve had some interest from a &lt;a href=&quot;https://github.com/ZaneA/WacomWebPlugin/issues/1&quot;&gt;curious Githubber&lt;/a&gt; wanting to port his notetaking program (&lt;a href=&quot;https://github.com/wavewave/hoodle&quot; title=&quot;wavewave/hoodle: hoodle : A pen notetaking program written in haskell&quot;&gt;hoodle&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/8125f2cd9cfa123ccf236c447927a220?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt;) to the web, so I&amp;#39;ve decided to revive and rewrite the project. After updating my copy of FireBreath and being unable to compile the plugin without some modifications, I realised that I don&amp;#39;t really need the large FireBreath dependency after all (the plugin will likely only ever target Linux).&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>HashTWM Updates</title>
      <link>http://demonastery.org/2012/12/hashtwm-updates/</link>
      <pubDate>Fri, 21 Dec 2012 16:30:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2012/12/hashtwm-updates</guid>
      <description>&lt;p&gt;For the first time in.. a while, I have had a sudden inclination to do some updates to &lt;a href=&quot;https://github.com/ZaneA/HashTWM&quot; title=&quot;ZaneA/HashTWM: An automatic Tiling Window Manager for the Windows OS.&quot;&gt;HashTWM&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/583ce06565a8619dc5caad4b5ebc318a?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt;. So far I&amp;#39;ve mostly just done some cleanups and code style changes, but one major feature that I&amp;#39;ve just added is the ability to &lt;em&gt;whitelist&lt;/em&gt; a few window classes and have HashTWM only tile those windows, as opposed to all (or blacklisting). I believe this was a feature suggested to me a while ago that I had misinterpreted (durr). Oh well it is finally done and is very useful :)&lt;/p&gt;

&lt;p&gt;Just in time for the end of the world.&lt;/p&gt;

&lt;h2&gt;What&amp;#39;s Next.&lt;/h2&gt;

&lt;p&gt;I have conceived many pet projects with the goal of replacing HashTWM in the long run, but I think that the best chance that HashTWM has is for me to port features from those prototypes back into the mainline.&lt;/p&gt;

&lt;p&gt;The major features I will be wanting to add are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A scripting language of some kind, at least as a way of enabling more powerful configuration. Leaning towards a Scheme (maybe &lt;a href=&quot;http://www.call-cc.org&quot;&gt;Chicken&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;More powerful keybindings (and even chaining) using a keyhook (from &lt;a href=&quot;https://github.com/ZaneA/HackWM&quot; title=&quot;ZaneA/HackWM: Next Generation Tiling Window Manager for Microsoft Windows.&quot;&gt;HackWM&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/583ce06565a8619dc5caad4b5ebc318a?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt;).&lt;/li&gt;
&lt;li&gt;Some kind of remote, for external displays/control. This should keep it nice and light while allowing you to see tags, and other useful info.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hopefully as my Windows laptop gets more use in the coming months I will be able to contribute more time to HashTWM. Thanks to everyone that has been following the project and still has an interest :)&lt;/p&gt;

&lt;p&gt;Happy Holidays!&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>"Monkey Patching" in Ruby</title>
      <link>http://demonastery.org/2012/11/monkey-patching-in-ruby/</link>
      <pubDate>Thu, 29 Nov 2012 18:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2012/11/monkey-patching-in-ruby</guid>
      <description>&lt;p&gt;I don&amp;#39;t use a whole lot of Ruby in my day to day work, but it is a language that is very quickly growing on me for several reasons.&lt;/p&gt;

&lt;p&gt;As I further integrate &lt;a href=&quot;https://github.com/mojombo/jekyll&quot; title=&quot;mojombo/jekyll: Jekyll is a blog-aware, static site generator in Ruby&quot;&gt;jekyll&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/25c7c18223fb42a4c6ae1c8db6f50f9b?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt; into my website pipeline, I&amp;#39;m finding more of a need to extend it with plugins, no surprises there. One particular plugin that I was previously using is &lt;a href=&quot;https://github.com/ixti/jekyll-assets&quot; title=&quot;ixti/jekyll-assets: Assets pipelines for Jekyll.&quot;&gt;jekyll-assets&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/aae6d4accf06084efc742f85d3806b33?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt;. I have since moved over to &lt;a href=&quot;https://github.com/matthodan/jekyll-asset-pipeline&quot; title=&quot;matthodan/jekyll-asset-pipeline: Powerful asset pipeline for Jekyll that collects, converts and compresses JavaScript and CSS assets&quot;&gt;jekyll-asset-pipeline&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/b365ad206b50f7ad7fa838aad6fc147b?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt; as it better serves my needs, but this article remains.&lt;/p&gt;

&lt;p&gt;Jekyll-assets provides a &lt;a href=&quot;https://github.com/sstephenson/sprockets&quot; title=&quot;sstephenson/sprockets: Rack-based asset packaging system&quot;&gt;sprockets&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/5b9fe87ec1faa67a4599782930f45ec9?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt; based asset pipeline, closely mirroring the pipeline present in Rails. The asset pipeline allows me to quickly concatenate and process multiple JavaScript and CSS files into single output bundles; reducing the amount of requests made when loading a page, and thereby improving load time. I also use it to build CoffeeScript and SASS stylesheets.&lt;/p&gt;

&lt;h2&gt;What is Monkey Patching?&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Monkey_patch&quot;&gt;Monkey patching&lt;/a&gt; refers to the ability to modify existing code at runtime and outside of regular means (ie. editing the original source). This can be useful as a way to add often-needed functions to a basic type, and in the case of Ruby where everything is an object, this can even include adding methods to numbers themselves (which are of the &lt;code&gt;FixNum&lt;/code&gt; class), for example:&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>A Jekyll hook for Gitolite</title>
      <link>http://demonastery.org/2012/11/jekyll-gitolite-hook/</link>
      <pubDate>Tue, 20 Nov 2012 21:39:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2012/11/jekyll-gitolite-hook</guid>
      <description>&lt;p&gt;I&amp;#39;m back again to share a quick hook for updating a &lt;a href=&quot;https://github.com/mojombo/jekyll&quot; title=&quot;mojombo/jekyll: Jekyll is a blog-aware, static site generator in Ruby&quot;&gt;jekyll&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/25c7c18223fb42a4c6ae1c8db6f50f9b?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt; based website or blog upon pushing to &lt;a href=&quot;https://github.com/sitaramc/gitolite&quot; title=&quot;sitaramc/gitolite: Hosting git repositories -- Gitolite allows you to setup git hosting on a central server, with very fine-grained access control and many (many!) more powerful features.  [IMPORTANT: please click and read the WIKI link above before submitting issues, pull requests, etc]&quot;&gt;gitolite&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/f731ab5313beb6fd680c8a9a51612925?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt;.&lt;/p&gt;

&lt;h2&gt;What is Jekyll?&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mojombo/jekyll&quot; title=&quot;mojombo/jekyll: Jekyll is a blog-aware, static site generator in Ruby&quot;&gt;jekyll&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/25c7c18223fb42a4c6ae1c8db6f50f9b?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt; is a small website/blog generator written in Ruby. It takes several templates, pages and posts, and combines them into a fully functional site ready to be served by any webserver.&lt;/p&gt;

&lt;p&gt;I&amp;#39;ve used Jekyll to power this blog for a few months now as the ability for me to write posts in &lt;a href=&quot;http://daringfireball.net/projects/markdown/&quot;&gt;Markdown&lt;/a&gt; and keep them stored in git is highly valuable for me. Previously I have been building the site locally and pushing the generated content to my VPS, but this is suboptimal and causes massive changesets (as you can imagine). Time to move that processing to the server where it rightly belongs.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Live project documentation in Redmine</title>
      <link>http://demonastery.org/2012/11/project-documentation-in-redmine/</link>
      <pubDate>Sun, 18 Nov 2012 13:27:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2012/11/project-documentation-in-redmine</guid>
      <description>&lt;p&gt;Continuing this &lt;a href=&quot;/2012/10/a-redmine-hook/&quot;&gt;series&lt;/a&gt; of posts on &lt;a href=&quot;/2012/09/a-hooking-system-for-gitolite/&quot;&gt;Gitolite hooks&lt;/a&gt;, this time I will be adding live project documentation to Redmine, using &lt;a href=&quot;http://www.doxygen.org&quot;&gt;Doxygen&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href='/images/2012-11-18/redmine-documentation.png'&gt;&lt;img src='/images/2012-11-18/redmine-documentation_400x.png' /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Background.&lt;/h2&gt;

&lt;p&gt;Documentation is often as important as code itself, especially when working in a team or introducing new programmers.&lt;/p&gt;

&lt;p&gt;But keeping generated documentation up to date is a pain, and it really shouldn&amp;#39;t be.&lt;/p&gt;

&lt;p&gt;At &lt;a href=&quot;http://www.codeshack.co.nz&quot;&gt;CodeShack&lt;/a&gt; we use Redmine as our project/task tracker. From here our developers have access to relevant projects with the ability to directly view the repository for that project, so why not add a &amp;quot;Documentation Tab&amp;quot; too?&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>A SkypeKit transport for DCBot</title>
      <link>http://demonastery.org/2012/10/skypekit-transport-for-dcbot/</link>
      <pubDate>Mon, 29 Oct 2012 22:30:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2012/10/skypekit-transport-for-dcbot</guid>
      <description>&lt;p&gt;A couple of posts back I walked through putting together a (somewhat) &lt;a href=&quot;http://demonastery.org/2012/07/building-a-decoupled-irc-bot-part-zero/&quot;&gt;decoupled bot system&lt;/a&gt; using &lt;a href=&quot;http://zero.mq&quot;&gt;ZeroMQ&lt;/a&gt; and a bunch of scripts in various languages.&lt;/p&gt;

&lt;p&gt;The transports I supplied as part of the example were for IRC and a local console. At the time I had also written a very basic &lt;a href=&quot;http://developer.skype.com&quot;&gt;SkypeKit&lt;/a&gt; transport but had decided not to release it as I was unsure about the terms and conditions surrounding this type of use (it previously had banned &amp;quot;server-side&amp;quot; usage, and likely still does, however my interpretation of that is a little fuzzy). So while I&amp;#39;m still unsure about it I figure there&amp;#39;s no harm in releasing it with a disclaimer that you &lt;em&gt;use this at your own risk&lt;/em&gt;.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>A Redmine hook for repo updates</title>
      <link>http://demonastery.org/2012/10/a-redmine-hook/</link>
      <pubDate>Sun, 28 Oct 2012 13:50:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2012/10/a-redmine-hook</guid>
      <description>&lt;p&gt;In my last post I showed how to build a simple &lt;a href=&quot;/2012/09/a-hooking-system-for-gitolite&quot;&gt;hooking system&lt;/a&gt; for &lt;a href=&quot;https://github.com/sitaramc/gitolite&quot; title=&quot;sitaramc/gitolite: Hosting git repositories -- Gitolite allows you to setup git hosting on a central server, with very fine-grained access control and many (many!) more powerful features.  [IMPORTANT: please click and read the WIKI link above before submitting issues, pull requests, etc]&quot;&gt;gitolite&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/f731ab5313beb6fd680c8a9a51612925?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt; Now I just want to share a very small script used to update &lt;a href=&quot;http://redmine.org&quot;&gt;Redmine&lt;/a&gt; changesets when you push to a git repository.&lt;/p&gt;

&lt;h2&gt;Background.&lt;/h2&gt;

&lt;p&gt;Redmine has an excellent repository viewer built in. It is even capable of reading through commit messages and closing tickets based on the contents, a very useful feature that we are taking advantage of. Due to this, having a team member commit a bug fix can fire off an email to the person who originally created the bug ticket, or at least it should.&lt;/p&gt;

&lt;h2&gt;The problem.&lt;/h2&gt;

&lt;p&gt;By default Redmine only processes these repositories when you visit the repository tab in a project. This makes sense, how else is it supposed to know when you&amp;#39;ve actually updated the repository? The most common solution to the problem is to set up cron to run a task to tell Redmine to update all repositories. Excellent, we can use this in a hook and make it all on demand and avoid wasting precious cycles ;)&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>A hooking system for Gitolite</title>
      <link>http://demonastery.org/2012/09/a-hooking-system-for-gitolite/</link>
      <pubDate>Fri, 07 Sep 2012 23:42:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2012/09/a-hooking-system-for-gitolite</guid>
      <description>&lt;p&gt;&lt;a href=&quot;https://github.com/sitaramc/gitolite&quot; title=&quot;sitaramc/gitolite: Hosting git repositories -- Gitolite allows you to setup git hosting on a central server, with very fine-grained access control and many (many!) more powerful features.  [IMPORTANT: please click and read the WIKI link above before submitting issues, pull requests, etc]&quot;&gt;gitolite&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/f731ab5313beb6fd680c8a9a51612925?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt; is a wonderful tool that makes hosting git repositories pain-free. Gitolite also supports adding custom hooks but for whatever reason I found it a little hard to get my head around for what I wanted (a &lt;code&gt;post-receive&lt;/code&gt; hook per repository).&lt;/p&gt;

&lt;p&gt;For that reason I&amp;#39;ve written up a guide to setting up custom &lt;code&gt;post-receive&lt;/code&gt; hooks for your repositories to automate various actions. Let&amp;#39;s get started.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Building a decoupled IRC bot. Part Two: Functionality</title>
      <link>http://demonastery.org/2012/08/building-a-decoupled-irc-bot-part-two/</link>
      <pubDate>Sun, 05 Aug 2012 00:44:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2012/08/building-a-decoupled-irc-bot-part-two</guid>
      <description>&lt;p&gt;Welcome to part three of this series. In this post I&amp;#39;m going to show how easy it is to turn what is currently a completely useless bot into something genuinely useful to you and your team.&lt;/p&gt;

&lt;h2&gt;Why Use a Bot?&lt;/h2&gt;

&lt;p&gt;We interact with many systems every working day, and very often we are doing this as part of a larger team.&lt;/p&gt;

&lt;p&gt;Bots in whatever shape or form allow us to coordinate, automate, and enrich communication amongst our team.&lt;/p&gt;

&lt;p&gt;In this example we will build in the ability for our bot to notice a bug ID within a message and return some data about that bug.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Building a decoupled IRC bot. Part One: Transports</title>
      <link>http://demonastery.org/2012/07/building-a-decoupled-irc-bot-part-one/</link>
      <pubDate>Sun, 22 Jul 2012 00:20:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2012/07/building-a-decoupled-irc-bot-part-one</guid>
      <description>&lt;p&gt;Welcome to part two (well, &amp;quot;One&amp;quot; because we started at &amp;quot;Zero&amp;quot;) of this series. One thing I realised after writing the first part is that I didn&amp;#39;t really provide a definition of &lt;em&gt;decoupling&lt;/em&gt; (which &lt;em&gt;is kind of&lt;/em&gt; important).&lt;/p&gt;

&lt;h2&gt;What is Decoupling?&lt;/h2&gt;

&lt;p&gt;When referring to software, it is the process of removing coupling or dependencies between individual parts of a system. When decoupling is achieved correctly, the failure of one part of a system should not result in the other parts failing.&lt;/p&gt;

&lt;p&gt;The bot that we are implementing is only loosely decoupled, in the sense that one part failing won&amp;#39;t cause the bot to lose a connection (unless the transport is the part failing of course).&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Building a decoupled IRC bot. Part Zero: Core</title>
      <link>http://demonastery.org/2012/07/building-a-decoupled-irc-bot-part-zero/</link>
      <pubDate>Mon, 16 Jul 2012 08:30:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2012/07/building-a-decoupled-irc-bot-part-zero</guid>
      <description>&lt;p&gt;In todays episode of demonastery.org I&amp;#39;m going to build yet another IRC bot!&lt;/p&gt;

&lt;p&gt;For this series however I am going to focus on the idea of decoupling. That is to say, separating out the functionality of the bot from the transports by way of a message queue (in this case we will be using &lt;a href=&quot;http://zero.mq&quot;&gt;ZeroMQ&lt;/a&gt;). By the end of this &lt;em&gt;three part&lt;/em&gt; series we will have a bot that is mostly decoupled, allowing functionality and transports to be added and removed on the fly. Each part of this bot can run on separate machines and will be written in different languages!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2012-07-15/dcbot.png&quot; alt=&quot;DCBot&quot;&gt;&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Lambda concealing in Vim</title>
      <link>http://demonastery.org/2012/07/lambda-conceal-in-vim/</link>
      <pubDate>Fri, 13 Jul 2012 13:30:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2012/07/lambda-conceal-in-vim</guid>
      <description>&lt;p&gt;One of the features I miss the most from Emacs when using Vim is the ability to mask certain strings as other strings (eg. Unicode symbols). The most often used case for this is when dealing with Greek characters (such as &lt;em&gt;lambda&lt;/em&gt;), or when writing Tex.&lt;/p&gt;

&lt;p&gt;Luckily, a guy named Vince Negri &lt;a href=&quot;https://sites.google.com/site/vincenegri/&quot;&gt;wrote a patch&lt;/a&gt; for Vim to provide a &amp;quot;Conceal&amp;quot; functionality. Most of the examples I&amp;#39;ve found for using this functionality deal with either Tex, or only with certain languages. It turns out it&amp;#39;s pretty easy to force it for all file types though, simply place this at the end of your &lt;code&gt;.vimrc&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;vim&quot;&gt;au &lt;span class=&quot;nb&quot;&gt;VimEnter&lt;/span&gt; * &lt;span class=&quot;nb&quot;&gt;syntax&lt;/span&gt; keyword Statement lambda conceal cchar&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;λ
au &lt;span class=&quot;nb&quot;&gt;VimEnter&lt;/span&gt; * &lt;span class=&quot;nb&quot;&gt;hi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;!&lt;/span&gt; link Conceal Statement
au &lt;span class=&quot;nb&quot;&gt;VimEnter&lt;/span&gt; * &lt;span class=&quot;k&quot;&gt;set&lt;/span&gt; conceallevel&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;And enjoy your beautiful new &amp;#955;&amp;#39;s :)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://i.imgur.com/P90qD.png&quot;&gt;&lt;img src=&quot;http://i.imgur.com/P90qDm.png&quot; alt=&quot;Lambda&quot;&gt;&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>The Perfect Android Emulator</title>
      <link>http://demonastery.org/2012/03/the-perfect-android-emulator/</link>
      <pubDate>Thu, 08 Mar 2012 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2012/03/the-perfect-android-emulator</guid>
      <description>&lt;p&gt;I&amp;#39;ve recently been getting further into Android development and as most people that have touched the official SDK know, the Android emulator is giant pain in the ass to work with. The reason it is slow is a combination of factors (ARM - x86 conversion, slow screen updates), but fortunately thanks to the Androidx86 project you don&amp;#39;t have to live with it any more.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://i.imgur.com/1SnAM.png&quot;&gt;&lt;img src=&quot;http://i.imgur.com/1SnAMm.png&quot; alt=&quot;Android&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Androidx86 project aims to port AOSP to the x86 architecture and supply drivers for common devices; it does this well and is getting better with every release. I&amp;#39;m going to show you how to set up the perfect Android VM for development (this assumes you have the rest of the SDK working fine, including access to &lt;code&gt;adb&lt;/code&gt; from the command-line).&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>LogPixels DPI hack</title>
      <link>http://demonastery.org/2012/01/logpixels-dpi-hack/</link>
      <pubDate>Wed, 04 Jan 2012 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2012/01/logpixels-dpi-hack</guid>
      <description>&lt;p&gt;Here&amp;#39;s a handy tip for those netbook users out there in dire need of more screen estate. You can force a DPI value of lower than 96 by using the Windows registry. To do so open &lt;code&gt;regedit&lt;/code&gt;, navigate to &lt;code&gt;HKEY_CURRENT_CONFIG/Software/Fonts/LogPixels&lt;/code&gt; and change the decimal value from &lt;code&gt;96&lt;/code&gt; to something lower such as &lt;code&gt;80&lt;/code&gt;. Then log out and back in and you will see the changes. I&amp;#39;m using a value of 80 on my netbook and it is about the most that I will drop it while still keeping things (half) readable. You will notice that it really hinders the readability of fonts as well as having some strange bitmap scaling artifacts, but if you&amp;#39;re like me and can adjust to it then the extra screen space gained is well worth it :)&lt;/p&gt;

&lt;p&gt;You can view a side by side comparison of the my desktop with LogPixels at 80 and at 96 by viewing this &lt;a href=&quot;http://imgur.com/a/9qYTk#0&quot;&gt;imgur album&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://i.imgur.com/DKnsW.jpg&quot;&gt;&lt;img src=&quot;http://i.imgur.com/DKnsWm.jpg&quot; alt=&quot;http://i.imgur.com/DKnsWm.jpg&quot;&gt;&lt;/a&gt; &lt;a href=&quot;http://i.imgur.com/JHrJi.jpg&quot;&gt;&lt;img src=&quot;http://i.imgur.com/JHrJim.jpg&quot; alt=&quot;http://i.imgur.com/JHrJim.jpg&quot;&gt;&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Docstrings in my Chicken?</title>
      <link>http://demonastery.org/2011/11/docstrings-in-my-chicken/</link>
      <pubDate>Sun, 13 Nov 2011 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/11/docstrings-in-my-chicken</guid>
      <description>&lt;p&gt;Here&amp;#39;s a little bit of amateur code to enable the use of &lt;a href=&quot;http://en.wikipedia.org/wiki/Docstring&quot;&gt;docstrings&lt;/a&gt; in Chicken Scheme. I haven&amp;#39;t written any Scheme in a few months and don&amp;#39;t have any formal training in the ninja art of &lt;a href=&quot;http://en.wikipedia.org/wiki/Hygienic_macro#explicit_renaming&quot;&gt;explicit renaming macros&lt;/a&gt; so I&amp;#39;d appreciate any feedback from Scheme veterans:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;scheme&quot;&gt;&lt;span class=&quot;c1&quot;&gt;;;; Docstrings for Chicken!&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;;; The hash-table that will contain the procedures and their associated&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;;; documentation strings as well as their code for later use.&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;define &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;*documentation-hash-table*&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;make-hash-table&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;;; Documented define er-macro&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;define-syntax &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;define*&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;form&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;r&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;let* &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;args-form&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;second&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;     &lt;span class=&quot;c1&quot;&gt;; (proc args)&lt;/span&gt;
         &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;proc-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;first&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;args-form&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;;  proc&lt;/span&gt;
         &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;doc&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;third&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;            &lt;span class=&quot;c1&quot;&gt;; &amp;quot;The docstring&amp;quot;&lt;/span&gt;
         &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;drop&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;form&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)))&lt;/span&gt;         &lt;span class=&quot;c1&quot;&gt;; (everything else)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;hash-table-set!&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;*documentation-hash-table*&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;proc-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;list &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;doc&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;; insert the doc and code body&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;r&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;&amp;#39;define&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;args-form&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;,@&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)))&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;; Define the procedure as normal&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;;; Example of a documented procedure, will print a nice-ish list of documented procedures&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;define*&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;print-docs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;&amp;quot;Print a list of documented procedures&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;hash-table-walk&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;*documentation-hash-table*&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;lambda &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;~a =&amp;gt; ~a~n  ~a~n~n&amp;quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;first&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;second&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)))))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Another example of why Scheme is such a fun language to work with :)&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Twitter's Bootstrap</title>
      <link>http://demonastery.org/2011/11/twitter-s-bootstrap/</link>
      <pubDate>Fri, 04 Nov 2011 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/11/twitter-s-bootstrap</guid>
      <description>&lt;p&gt;To me, one of the most annoying parts of prototyping a new web application is getting a presentable look and feel up quickly. When I&amp;#39;m prototyping stuff I love to have a good looking interface from the start, even if that interface will be changed before going live.&lt;/p&gt;

&lt;p&gt;Recently, Twitter released a wonderful CSS/JS framework named &lt;a href=&quot;http://twitter.github.com/bootstrap/&quot;&gt;Bootstrap&lt;/a&gt; for this exact purpose. As stated it is a toolkit &amp;quot;[...] designed to kickstart development of webapps and sites.&amp;quot;. It combines an aesthetically pleasing base styling (based somewhat off of Twitter itself) of HTML elements with an easy to use CSS grid, great browser compatibility, and various optional Javascript modules to extend functionality of things such as Drop-down menus and modal dialogs.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Das Keyboard Ultimate</title>
      <link>http://demonastery.org/2011/10/das-keyboard-ultimate/</link>
      <pubDate>Wed, 12 Oct 2011 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/10/das-keyboard-ultimate</guid>
      <description>&lt;p&gt;I took the plunge recently and bought my first mechanical keyboard, the &lt;a href=&quot;http://daskeyboard.com&quot;&gt;Das Keyboard Ultimate&lt;/a&gt;. It was very hard to find someone that would ship one to NZ, but eventually I found &lt;a href=&quot;http://auspcmarket.com.au&quot;&gt;AusPCMarket&lt;/a&gt; that ships the Das as well as several other &amp;quot;clicky keyboards&amp;quot;. The Das is known for being a bit pricey.. the Ultimate set me back &lt;em&gt;$230NZD&lt;/em&gt; (incl shipping and GST) at the current exchange rate and was delivered in just over a week. If you need to justify the price by thinking of it as an investment, then do :)&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Tiny Memcached Wrapper</title>
      <link>http://demonastery.org/2011/08/tiny-memcached-wrapper/</link>
      <pubDate>Fri, 12 Aug 2011 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/08/tiny-memcached-wrapper</guid>
      <description>&lt;p&gt;No posts in a while huh! Been pretty busy and haven&amp;#39;t thought of much to blog about lately. But I&amp;#39;ve been playing with &lt;a href=&quot;http://memcached.org/&quot;&gt;Memcache&lt;/a&gt; and wanted to share a tiny class I made to add easy caching to my PHP projects. This PHP class just provides a nice simple interface to use by extending the &lt;code&gt;Memcached&lt;/code&gt; class:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Call the class whatever you want&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;MyCache&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Memcached&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;cache&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$key&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$val&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$key&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;nv&quot;&gt;$val&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
            &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$key&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$val&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;strtotime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;());&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$val&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Emacs Tip: Vimpulse</title>
      <link>http://demonastery.org/2011/07/emacs-tip-vimpulse/</link>
      <pubDate>Thu, 07 Jul 2011 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/07/emacs-tip-vimpulse</guid>
      <description>&lt;p&gt;One thing I love about Emacs is that it is so extensible. I was an avid Vim user for a long time and it took me several tries to switch to Emacs, but I will never look back. With the &lt;a href=&quot;http://gitorious.org/vimpulse&quot;&gt;Vimpulse&lt;/a&gt; addon to the built-in &lt;code&gt;viper-mode&lt;/code&gt;, Emacs becomes a powerful Vim impersonator, capable of being extended with Emacs-Lisp.&lt;/p&gt;

&lt;p&gt;A lot of my time is spent doing web development, and so strong HTML editing ability is essential in any editor I use. Vim has this amazing concept of &lt;a href=&quot;http://vimdoc.sourceforge.net/htmldoc/motion.html#text-objects&quot;&gt;text objects&lt;/a&gt; which allows you to be very efficient when transforming text; one of the most useful when doing web development is therefore the XML/HTML tag text object. I would use this all the time by invoking &lt;code&gt;cit&lt;/code&gt; to change text between a pair of tags. To demonstrate, here&amp;#39;s a piece of text you might have sitting in a file:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;xml&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Hello |World&lt;span class=&quot;nt&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Now with the cursor somewhere in between the tags (visualized above by the pipe, &amp;#39;|&amp;#39;) we can go into command mode and type &lt;code&gt;cit&lt;/code&gt; and the above will be replaced with:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;xml&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;|&lt;span class=&quot;nt&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Ready to be edited!&lt;/p&gt;

&lt;p&gt;Well sadly, Vimpulse doesn&amp;#39;t have this feature by default, probably one of the very few parts of Vim that it doesn&amp;#39;t emulate in fact! (NB. &lt;a href=&quot;http://gitorious.org/evil/pages/Home&quot;&gt;Evil&lt;/a&gt; contains emulation for this already) But not to worry, we can just add it in! This is Emacs after all.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Org-mode Conky Colorizer</title>
      <link>http://demonastery.org/2011/06/org-mode-conky-colorizer/</link>
      <pubDate>Sun, 05 Jun 2011 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/06/org-mode-conky-colorizer</guid>
      <description>&lt;p&gt;Just whipped up a little script to colorize my &lt;a href=&quot;http://orgmode.org&quot;&gt;org-mode&lt;/a&gt; todo lists for display via &lt;a href=&quot;http://conky.sourceforge.net&quot;&gt;Conky&lt;/a&gt;. It&amp;#39;s bound to be of use to someone so I thought I&amp;#39;d better share :)&lt;/p&gt;

&lt;p&gt;Here&amp;#39;s a &lt;a href=&quot;http://i.imgur.com/mqYUG.png&quot;&gt;screenshot of it in action&lt;/a&gt;, sitting in the corner of my desktop.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://i.imgur.com/mqYUG.png&quot;&gt;&lt;img src=&quot;http://i.imgur.com/mqYUGm.jpg&quot; alt=&quot;http://i.imgur.com/mqYUGm.jpg&quot;&gt;&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Adding FreeType to our Demo</title>
      <link>http://demonastery.org/2011/06/adding-freetype-to-our-demo/</link>
      <pubDate>Sun, 05 Jun 2011 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/06/adding-freetype-to-our-demo</guid>
      <description>&lt;p&gt;Continuing on from my &lt;a href=&quot;http://demonastery.org/60/chicken-scheme-and-opengl/&quot;&gt;Chicken Scheme, and OpenGL&lt;/a&gt; tutorial, I&amp;#39;m going to show you how to extend it to render pretty FreeType text using the &lt;a href=&quot;http://homepages.paradise.net.nz/henryj/code/&quot;&gt;FTGL&lt;/a&gt; library. Follow the code below for details as always; it&amp;#39;s really easy! :)&lt;/p&gt;

&lt;p&gt;Users of ArchLinux can get &lt;em&gt;FTGL&lt;/em&gt; with a simple &lt;code&gt;sudo pacman -S ftgl&lt;/code&gt;. Debian should be something like &lt;code&gt;sudo apt-get install libftgl-dev&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Alright lets start by loading up the code from last time ...&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Org-agenda-sms.el</title>
      <link>http://demonastery.org/2011/05/org-agenda-sms-el/</link>
      <pubDate>Thu, 12 May 2011 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/05/org-agenda-sms-el</guid>
      <description>&lt;p&gt;So my warmup for today was to rewrite my old &lt;a href=&quot;http://demonastery.org/25/automatic-agenda-notification/&quot;&gt;org-mode agenda notification code&lt;/a&gt; to use Emacs lisp instead of Python.
The aim of this code is to check your &lt;a href=&quot;http://orgmode.org&quot;&gt;org-mode&lt;/a&gt; agenda for any headings with DEADLINEs and create a vcalendar for each, and then send them to your phone via &lt;a href=&quot;http://clickatell.com&quot;&gt;Clickatell&lt;/a&gt;.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>More Practical Chicken</title>
      <link>http://demonastery.org/2011/05/more-practical-chicken/</link>
      <pubDate>Thu, 12 May 2011 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/05/more-practical-chicken</guid>
      <description>&lt;p&gt;As I love sharing code on my blog, and I love &lt;a href=&quot;http://call-cc.org&quot;&gt;Chicken Scheme&lt;/a&gt;, I&amp;#39;m going to share a couple of handy and practical features that I&amp;#39;ve made use of recently.&lt;/p&gt;

&lt;p&gt;Anyone that has used C++ for longer than a few minutes has probably noticed that literal constants (*numbers and such*) often have a suffix attached to them. The most common place that you&amp;#39;ll see this is when writing floating-point decimals, ie. &lt;strong&gt;1.0f&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;They might seem a little pointless at first, but they have their uses; I swear that I once read of a way to add your own types into the language too.&lt;/p&gt;

&lt;p&gt;But anyway, I searched for a way to do this in Chicken too, and it turns out it&amp;#39;s really easy (of course!). Chicken provides a function called &lt;a href=&quot;http://wiki.call-cc.org/man/4/Unit%20library#set-parameterized-read-syntax&quot;&gt;set-parameterized-read-syntax!&lt;/a&gt; that can emulate this functionality quite nicely.&lt;/p&gt;

&lt;p&gt;Here&amp;#39;s a real world case that I used recently, I wanted to be able to convert from inches into pixels, based on a known DPI (in this case 180). The code to set this up looks like this:&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>FileTools C++ Class</title>
      <link>http://demonastery.org/2011/05/filetools-c-class/</link>
      <pubDate>Sun, 08 May 2011 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/05/filetools-c-class</guid>
      <description>&lt;p&gt;Here is the source for the FileTools C++ Class promised &lt;a href=&quot;http://demonastery.org/63/c-eval-hell-yes/&quot;&gt;a few posts back&lt;/a&gt;, which uses &lt;a href=&quot;http://en.wikipedia.org/wiki/Inotify&quot;&gt;inotify&lt;/a&gt; to monitor files for changes.&lt;/p&gt;

&lt;p&gt;Again we start off with the class header:&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>CodeTools C++ Class</title>
      <link>http://demonastery.org/2011/05/codetools-c-class/</link>
      <pubDate>Sat, 07 May 2011 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/05/codetools-c-class</guid>
      <description>&lt;p&gt;As promised &lt;a href=&quot;http://demonastery.org/63/c-eval-hell-yes/&quot;&gt;a couple of posts back&lt;/a&gt;, I will present a C++ class to compile some arbitrary code using &lt;a href=&quot;http://en.wikipedia.org/wiki/GNU_Compiler_Collection&quot;&gt;GCC&lt;/a&gt; and load it into memory.&lt;/p&gt;

&lt;p&gt;The code is pretty simple, we start off with the class header:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;cpp&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// CodeTools.hpp&lt;/span&gt;

&lt;span class=&quot;cp&quot;&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;#include &amp;lt;dlfcn.h&amp;gt;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;typedef&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;CodeTools&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;bool&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;compileString&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;bool&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;callback&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;bool&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;compileFile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;bool&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;callback&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pCodeTools&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Fun with Renoise and Fluxus</title>
      <link>http://demonastery.org/2011/05/fun-with-renoise-and-fluxus/</link>
      <pubDate>Mon, 02 May 2011 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/05/fun-with-renoise-and-fluxus</guid>
      <description>&lt;p&gt;Amidst my experimentations with livecoding I decided to purchase the amazing &lt;a href=&quot;http://www.renoise.com&quot;&gt;Renoise&lt;/a&gt; Tracker (and overall DAW) while it is on special (30% discount!). My intentions are to play around with Renoise to make music (online and off), and using the built in &lt;a href=&quot;http://opensoundcontrol.org/introduction-osc&quot;&gt;OSC&lt;/a&gt; and &lt;a href=&quot;http://jackaudio.org/&quot;&gt;JACK&lt;/a&gt; support, coordinate the music using &lt;a href=&quot;http://www.pawfal.org/fluxus/&quot;&gt;Fluxus&lt;/a&gt;, and of course be able to respond to it. I am also toying with the idea of using an &lt;a href=&quot;http://arduino.cc&quot;&gt;Arduino&lt;/a&gt; or two as input devices. Fun stuff I reckon :P&lt;/p&gt;

&lt;p&gt;For anyone wondering how to make Fluxus respond to the Renoise audio, it is simple using JACK:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;scheme&quot;&gt;&lt;span class=&quot;c1&quot;&gt;; If I remember correctly you may need to connect the Renoise&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;; output to the Fluxus input using something like qjackctl first&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;start-audio&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;renoise:output_01_left&amp;quot;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1024&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;44100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;; This will tell Fluxus to listen to the left channel..&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;gain&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;; .. and later in your render loop, using the &amp;quot;gh&amp;quot; function you can react to the sound&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;every-frame&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;begin&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;scale&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;vmul&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;vector &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;gh&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;gh&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;gh&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;draw-torus&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Pretty neat. Using OSC it is also really simple to control Renoise. First you will want to enable the OSC server in the Renoise preferences, and then you can use the following:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;scheme&quot;&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;osc-destination&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;osc.udp://localhost:8000&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;; With the port you specify in the preferences&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;osc-send&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;/renoise/song/bpm&amp;quot;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;i&amp;quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;list &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;120&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;; Set the BPM to 120&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;osc-send&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;/renoise/transport/start&amp;quot;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;; Start playback&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;osc-send&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;/renoise/transport/stop&amp;quot;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;; Stop playback&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Next up is to get Fluxus working nicely with Emacs.. and I promise some more updates will come shortly (including the code I&amp;#39;ve promised) :)&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>C++ Eval? Hell yes.</title>
      <link>http://demonastery.org/2011/04/c-eval-hell-yes/</link>
      <pubDate>Sat, 16 Apr 2011 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/04/c-eval-hell-yes</guid>
      <description>&lt;p&gt;Recently I&amp;#39;ve been getting back into &lt;a href=&quot;http://en.wikipedia.org/wiki/Live_coding&quot;&gt;live coding&lt;/a&gt;, and as part of that I have been experimenting with a simple livecoding framework in C++.&lt;/p&gt;

&lt;p&gt;One of my experiments involves using C++ as a &lt;em&gt;scripting language&lt;/em&gt;, by compiling code on the fly (using g++, but any compiler should work) into a shared object, and then &lt;a href=&quot;http://en.wikipedia.org/wiki/Dynamic_loading&quot;&gt;dlopen&lt;/a&gt;-ing the resultant file and hooking up the necessary functions.&lt;/p&gt;

&lt;p&gt;By doing this I can have full access to the engine/framework and speed is never a concern. It also means I can modify it later to load any arbitrary shared object (ie. generated via C or any other language, perhaps Chicken?).&lt;/p&gt;

&lt;p&gt;The workflow I desired to achieve was to have an OpenGL context open, blank at first. From there I could open the editor of my choice, hack on some high level C++/OpenGL, and when I saved the file, the engine would recompile the file and load it, causing its rendering function to be overridden with the new one.&lt;/p&gt;

&lt;p&gt;I&amp;#39;m happy to say I&amp;#39;ve achieved what I was after!&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Change GTK display on the fly</title>
      <link>http://demonastery.org/2011/04/change-gtk-display-on-the-fly/</link>
      <pubDate>Sat, 09 Apr 2011 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/04/change-gtk-display-on-the-fly</guid>
      <description>&lt;p&gt;While working on my &lt;a href=&quot;http://demonastery.org/59/acer-aspire-one-d255e/&quot;&gt;netbook&lt;/a&gt; away from my desktop machine, I pondered how I could view my email clients display (&lt;a href=&quot;http://claws-mail.org&quot;&gt;claws-mail&lt;/a&gt;, a GTK app), without having to resort to something such as &lt;a href=&quot;http://en.wikipedia.org/wiki/Virtual_Network_Computing&quot;&gt;VNC&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I know this can be done using utilities such as &lt;a href=&quot;http://en.wikipedia.org/wiki/Xmove&quot;&gt;xmove&lt;/a&gt;, which essentially act as a proxy X server that can detach a client from one display and move it to another. But this requires you to start xmove before the application, and to tell the application to launch with its display on xmove.&lt;/p&gt;

&lt;p&gt;Nah. &lt;em&gt;We need something cooler than this.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After using some Google fu it became apparent that the GTK library has a function named &lt;code&gt;gtk_window_set_screen&lt;/code&gt; which is demonstrated in the &lt;em&gt;gtk-demo&lt;/em&gt; application that comes with the GTK sources. This function allows the application to switch X11 display on the fly.. provided the application has a way to do so (which barely any do, apart from the GIMP, because most don&amp;#39;t need to).&lt;/p&gt;

&lt;p&gt;So I decided to look into ways of doing &lt;em&gt;code injection&lt;/em&gt; in Linux, as a way of being able to call that function inside our target application. Turns out this is easy as pie using &lt;a href=&quot;http://en.wikipedia.org/wiki/GNU_Debugger&quot;&gt;GDB&lt;/a&gt;.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Mimicking Threading in PHP</title>
      <link>http://demonastery.org/2011/04/mimicking-threading-in-php/</link>
      <pubDate>Sun, 03 Apr 2011 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/04/mimicking-threading-in-php</guid>
      <description>&lt;p&gt;People often criticize &lt;a href=&quot;http://php.net&quot;&gt;PHP&lt;/a&gt; for not having the ability to use &lt;a href=&quot;http://en.wikipedia.org/wiki/Thread_(computer_science&quot;&gt;threading&lt;/a&gt;), which is a fair point and quite often a drawback. Here I am presenting a method for mimicking threads through &lt;a href=&quot;http://en.wikipedia.org/wiki/Fork_(operating_system&quot;&gt;forking&lt;/a&gt;) of the PHP interpreter. This may not work as well on a Windows system since AFAIK forks are more expensive there than on unix (*I would love to be proven wrong however!*). You will also need to make sure that you have the &lt;code&gt;extension=sockets.so&lt;/code&gt; somewhere in your &lt;strong&gt;php.ini&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The code is very simple and short, it works using socket IPC and PHP serialization:&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Chicken Scheme, and OpenGL</title>
      <link>http://demonastery.org/2011/04/chicken-scheme-and-opengl/</link>
      <pubDate>Sat, 02 Apr 2011 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/04/chicken-scheme-and-opengl</guid>
      <description>&lt;p&gt;Today I&amp;#39;m posting an example of how you can quickly get started with &lt;a href=&quot;http://en.wikipedia.org/wiki/OpenGL&quot;&gt;OpenGL&lt;/a&gt; using &lt;a href=&quot;http://call-cc.org&quot;&gt;Chicken Scheme&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I am posting the code in full, but I have commented it pretty well and so everything should be quite simple to understand.&lt;/p&gt;

&lt;p&gt;Unless you take out the texture rendering, you will probably want to get &lt;a href=&quot;http://www.lonesock.net/soil.html&quot;&gt;SOIL&lt;/a&gt; for your distribution (Archers can get it with &lt;code&gt;sudo pacman -S soil&lt;/code&gt;).&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Acer Aspire ONE D255E</title>
      <link>http://demonastery.org/2011/03/acer-aspire-one-d255e/</link>
      <pubDate>Sun, 27 Mar 2011 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/03/acer-aspire-one-d255e</guid>
      <description>&lt;p&gt;A week ago I went searching for a small netbook. My requirements were pretty simple; it needed to be cheap, and be able to dual boot Linux and Windows 7. Because I&amp;#39;m in New Zealand, the first place I checked out was &lt;a href=&quot;http://dse.co.nz&quot;&gt;Dick Smith Electronics&lt;/a&gt;, which currently had a great special running on the Acer Aspire ONE D255E (**$399 NZD**, roughly &lt;strong&gt;$300 USD&lt;/strong&gt;). Now the specs listed on the site were actually false, but the actual specs of the laptop are higher.&lt;/p&gt;

&lt;p&gt;The machine uses the Intel Atom N455 processor, which is a dual core CPU running at 1.66GHz. It has 1GB of DDR3 memory, a 250GB Hard Drive (non-SSD of course), 10.1&amp;quot; LED LCD at 1024x600 (which is tiny, but well suited to a window manager such as &lt;a href=&quot;http://www.nongnu.org/ratpoison/&quot;&gt;ratpoison&lt;/a&gt;. The VGA port also handles my 1920x1080 display with no trouble), and comes with Windows 7 Starter edition. These specs seem reasonable to me, and I&amp;#39;m used to getting the most out of my hardware. For interest sake, the machine also has a built-in webcam, 2-in-1 card reader, 802 11b/g/n Wifi (Atheros), a Synaptics touchpad that has basic multi-touch support, and a 3-cell Li-ion battery that gives roughly 4 hours of battery life (can also upgrade to a 6-cell). This particular machine has no bluetooth, although it seems to be an optional extra (along with internal 3G), and of course no optical drive.&lt;/p&gt;

&lt;p&gt;The first thing I did when I unboxed this machine (after installing the battery) was format the hard drive (*Windows 7 starter is plenty capable, but it&amp;#39;s not for me*). After getting a hold of an external optical drive I proceeded to install Windows 7 Ultimate on it, giving Win7 about 60GB of space, using a single partition only (there&amp;#39;s a trick to getting rid of the &lt;em&gt;System Reserved partition&lt;/em&gt;, but it&amp;#39;s a pretty simple one). Once installed, I booted the machine up, and surprise surprise, there&amp;#39;s pretty much nil driver support for this thing using the built-in Win7 drivers. Even VGA was limited to 800x600. Luckily I have an extra machine on standby that I was able to use to download some drivers. Unfortunately this system is new enough that the drivers are only just hitting the net, and I wasn&amp;#39;t able to find the correct ones on the Acer site itself (If you want the names and download locations, ask in the comments). But after spending a couple of hours finding the correct ones, it was up and running smoothly.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>A Newbie Guide to Call/cc</title>
      <link>http://demonastery.org/2011/03/a-newbie-guide-to-call-cc/</link>
      <pubDate>Mon, 14 Mar 2011 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/03/a-newbie-guide-to-call-cc</guid>
      <description>&lt;p&gt;I haven&amp;#39;t had much to write about in the last couple of weeks, but I&amp;#39;ve really wanted to do a small piece on the magic of &lt;a href=&quot;http://en.wikipedia.org/wiki/Call-with-current-continuation&quot;&gt;call-with-current-continuation&lt;/a&gt; in Scheme, aka. &lt;strong&gt;call/cc&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For some reason I had a difficult time wrapping my head around this little statement, even though it isn&amp;#39;t terribly complicated at all (from an end coder perspective that is; I don&amp;#39;t want to imagine the headaches it causes for the compiler hackers ;)). For all intents and purposes, you can think of &lt;strong&gt;call/cc&lt;/strong&gt; as a glorified &lt;em&gt;return&lt;/em&gt; or a smart &lt;em&gt;goto&lt;/em&gt; statement (and that is how it will sound when I try to explain it).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;But first of all, what is this continuation thing?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You can think of a continuation as &lt;em&gt;an object that represents the position of execution in a running program&lt;/em&gt;. If we call a continuation object as though it were a function, we will jump to that position in the program, and continue the flow from there.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>A Scheme Infix Transformer</title>
      <link>http://demonastery.org/2011/03/a-scheme-infix-transformer/</link>
      <pubDate>Tue, 08 Mar 2011 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/03/a-scheme-infix-transformer</guid>
      <description>&lt;p&gt;As promised in the last post, I am going to share an &lt;a href=&quot;http://en.wikipedia.org/wiki/Infix_notation&quot;&gt;infix&lt;/a&gt; function, that takes a list that looks like &lt;code&gt;(1 + (2 * 3))&lt;/code&gt; and turns it into &lt;code&gt;(+ 1 (* 2 3))&lt;/code&gt; (&lt;a href=&quot;http://en.wikipedia.org/wiki/Prefix_notation&quot;&gt;Prefix&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Creating this function was a perfect place to start playing with &lt;a href=&quot;http://en.wikipedia.org/wiki/Unit_testing&quot;&gt;Unit Testing&lt;/a&gt; as well. Something that I have not used much of until now.&lt;/p&gt;

&lt;p&gt;Unit testing is really useful in this situation. We can write a tiny test that checks if our &lt;code&gt;infix/lr&lt;/code&gt; (lr because it parses left to right, not that it matters) function gives the appropriate result. That test will look like this:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;scheme&quot;&gt;&lt;span class=&quot;c1&quot;&gt;; Load the lightweight unit testing unit&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;srfi-78&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;; And write the test&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;check&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;infix/lr&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;; Check that this&lt;/span&gt;
       &lt;span class=&quot;k&quot;&gt;=&amp;gt; &lt;/span&gt;                           &lt;span class=&quot;c1&quot;&gt;; matches&lt;/span&gt;
       &lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;+ &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;* &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;         &lt;span class=&quot;c1&quot;&gt;; this&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</description>
    </item>
      
    
      
    <item>
      <title>An Intro to Scheme Macros</title>
      <link>http://demonastery.org/2011/03/an-intro-to-scheme-macros/</link>
      <pubDate>Mon, 07 Mar 2011 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/03/an-intro-to-scheme-macros</guid>
      <description>&lt;p&gt;In this post I want to go a little deeper into the &lt;a href=&quot;http://en.wikipedia.org/wiki/Macro_%28computer_science%29&quot;&gt;macro&lt;/a&gt; system of Scheme (particularly Chicken), and share a couple of macros I&amp;#39;ve created.&lt;/p&gt;

&lt;p&gt;First of all, macros are what make Scheme and Lisp so exciting. Macros offer the ability to evaluate code at &lt;em&gt;compile&lt;/em&gt; time, and modify the structure of a program &lt;em&gt;before it even runs&lt;/em&gt;. You can think of it as a really really powerful &lt;code&gt;#define&lt;/code&gt;, but where #define lets you modify text, a Lisp macro lets you modify the code structure itself.&lt;/p&gt;

&lt;p&gt;There are a couple of different kinds of macro available in Scheme, and as I&amp;#39;m somewhat of a young schemer I&amp;#39;m not completely sure which are available across all implementations and which are only available in Chicken. But I will assume that the macros here can be ported with relative ease.&lt;/p&gt;

&lt;p&gt;The first kind, looks a lot like a regular ol&amp;#39; function. It is even called like a function, only when this macro is read it leaves behind whatever it returns. Here&amp;#39;s an annotated example:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;scheme&quot;&gt;&lt;span class=&quot;c1&quot;&gt;; Here we are going to create a new macro called &amp;quot;return-me&amp;quot;&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;; that will simply return in a list whatever is passed to it&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;define-syntax &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;return-me&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;syntax-rules &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;; Any symbols placed in this list will be ignored&lt;/span&gt;
    &lt;span class=&quot;err&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;return-me&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;; This is what the arguments should look like&lt;/span&gt;
     &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;list &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;; And this is how they should be transformed&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;; Example&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;return-me&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;Hello&amp;quot;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;World&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Hello&amp;quot;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;World&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</description>
    </item>
      
    
      
    <item>
      <title>A Brief Foray into Haskell</title>
      <link>http://demonastery.org/2011/03/a-brief-foray-into-haskell/</link>
      <pubDate>Sun, 06 Mar 2011 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/03/a-brief-foray-into-haskell</guid>
      <description>&lt;p&gt;I&amp;#39;ve tried to learn &lt;a href=&quot;http://haskell.org&quot;&gt;Haskell&lt;/a&gt; in the past and found it completely horrible to look at. That was, until I got around to learning Scheme and decided to look deeper into it.&lt;/p&gt;

&lt;p&gt;A couple of nights ago a friend showed me a small piece of Haskell code which reads a series of lines formatted like this:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;a 1
b 2
c 3
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;And sums up the second column.
The code looks like this:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;haskell&quot;&gt;&lt;span class=&quot;nf&quot;&gt;foldl1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;map&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;read&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!!&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;map&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;words&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lines&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;a 1&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;b 2&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;c 3&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;At first glance, I was at a total loss as to what was going on. So I fumbled around in ghci for a while figuring out what each part was doing.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Quake 2 Hacking</title>
      <link>http://demonastery.org/2011/02/quake-2-hacking/</link>
      <pubDate>Sun, 20 Feb 2011 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/02/quake-2-hacking</guid>
      <description>&lt;p&gt;&lt;a href=&quot;http://i.imgur.com/60zIh.jpg&quot;&gt;&lt;img src=&quot;http://i.imgur.com/60zIhm.jpg&quot; alt=&quot;http://i.imgur.com/60zIhm.jpg&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Quake 2 (aka &lt;a href=&quot;http://en.wikipedia.org/wiki/Quake_II_engine&quot;&gt;id Tech 2&lt;/a&gt;) is a great game and engine to hack. The source is pretty well laid out and the code is small enough that it doesn&amp;#39;t take forever to become familiar with it. It also has a great entity system that makes it a really suitable for prototyping.&lt;/p&gt;

&lt;p&gt;I spent the last couple of nights stripping as much of the game code as I could out, right down to the essentials, and then stripping the game data down to the bare minimum as well. I built a plain cube map with a single info_null entity, that gets loaded on startup, acting as a gateway map. The info_null entity contains a &amp;quot;model&amp;quot; key, which loads an arbitrary md2 from disk (in this case, some couch model I found online).&lt;/p&gt;

&lt;p&gt;Next I set about embedding Chicken Scheme into the game code as an interpreter, and a few thousand segfaults later, it works! I have output redirection and an &amp;quot;eval&amp;quot; command for the console, allowing you to type some code and get a response.&lt;/p&gt;

&lt;p&gt;I also started on a high level API for controlling in game objects that I will just implement as I go, that looks a little like this:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;scheme&quot;&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;q2:fire-blaster&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;q2:get-player-by-name&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;Player&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;So for just a couple hours of work I have a decent engine and scripting language that can be built up in whatever direction I decide to go with it :D&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Sawfish Theme, GperfectionHash</title>
      <link>http://demonastery.org/2011/02/sawfish-theme-gperfectionhash/</link>
      <pubDate>Thu, 17 Feb 2011 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/02/sawfish-theme-gperfectionhash</guid>
      <description>&lt;p&gt;&lt;img src=&quot;http://fc00.deviantart.net/fs70/i/2011/047/a/3/gperfection_hash_for_sawfish_by_hashbox-d39pm73.png&quot; alt=&quot;http://fc00.deviantart.net/fs70/i/2011/047/a/3/gperfection_hash_for_sawfish_by_hashbox-d39pm73.png&quot;&gt;Just a simple modern SawfishWM theme I made, modified from gperfection.&lt;/p&gt;

&lt;p&gt;There is a dark version (named perfection-hash), and a light version (named gperfection-hash-light), to suit dark and light GTK themes (not included).&lt;/p&gt;

&lt;p&gt;Font in title is &lt;strong&gt;&amp;quot;Helvetica Neue Bold 7&amp;quot;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;To download, head over to &lt;a href=&quot;http://hashbox.deviantart.com/art/Gperfection-Hash-for-Sawfish-197710239&quot;&gt;http://hashbox.deviantart.com/art/Gperfection-Hash-for-Sawfish-197710239&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To install, unzip inside &lt;code&gt;~/.sawfish/themes/&lt;/code&gt; and select gperfection-hash(light) in Sawfish configuration.&lt;/p&gt;

&lt;p&gt;Have fun!&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Chicken Scheme, and FFI</title>
      <link>http://demonastery.org/2011/01/chicken-scheme-and-ffi/</link>
      <pubDate>Mon, 31 Jan 2011 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/01/chicken-scheme-and-ffi</guid>
      <description>&lt;p&gt;As a follow up on yesterdays post I&amp;#39;m going to show how easy it is to integrate some third party functionality in to a web application to provide &amp;quot;automatic tagging&amp;quot; using &lt;a href=&quot;http://libots.sourceforge.net&quot;&gt;libots&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To do this, we&amp;#39;re going to use the Chicken FFI. Now this example is really so short that there&amp;#39;s no point in splitting it into multiple blocks, so here we go:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;scheme&quot;&gt;&lt;span class=&quot;c1&quot;&gt;;; FFI example&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;foreign&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;; Add the libots header&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;foreign-declare&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;#include &amp;lt;libots-1/ots/libots.h&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;; Declare the function we&amp;#39;re going to use&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;define &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ots-text-topics&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;foreign-lambda&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;c-string&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;ots_text_topics&amp;quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;c-string&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;c-string&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;; And here&amp;#39;s another useful one&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;define &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ots-summarize&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;foreign-lambda*&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;c-string*&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;c-string&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;percent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
                   &lt;span class=&quot;s&quot;&gt;&amp;quot;OtsArticle* article = ots_new_article();&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;                    ots_load_xml_dictionary(article, \&amp;quot;en\&amp;quot;);&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;                    ots_parse_stream(str, strlen(str), article);&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;                    ots_grade_doc(article);&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;                    ots_highlight_doc(article, percent);&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;                    size_t outlen = 0;&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;                    char *text = ots_get_doc_text(article, &amp;amp;outlen);&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;                    ots_free_article(article);&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;                    C_return(text);&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;And now to use it (the automatic tagging part):&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;scheme&quot;&gt;&lt;span class=&quot;c1&quot;&gt;;; OTS tagging&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;let* &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;num-tags&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
       &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;This is the post you want to tag&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
       &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;tags&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;ots-text-topics&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;en&amp;quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;num-tags&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)))&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;display &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;string-append &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;The tags found are: &amp;quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;tags&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Now all that&amp;#39;s left is to compile it:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;csc code.scm &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;pkg-config --cflags --libs glib-2.0 libots-1 libxml-2.0&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;That&amp;#39;s really all there is to it!&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Chicken Scheme, and Web RAD</title>
      <link>http://demonastery.org/2011/01/chicken-scheme-and-web-rad/</link>
      <pubDate>Sun, 30 Jan 2011 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2011/01/chicken-scheme-and-web-rad</guid>
      <description>&lt;p&gt;Recently I&amp;#39;ve taken more of a liking to &lt;a href=&quot;http://call-cc.org&quot;&gt;Chicken Scheme&lt;/a&gt;, and started trying to use it for more of my day to day development. Recently I wrote a port (&lt;a href=&quot;https://github.com/ZaneA/PongClock&quot; title=&quot;ZaneA/PongClock: An OpenGL clock using the game of Pong. Ported directly from an HTML5 + JS version.&quot;&gt;PongClock&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/583ce06565a8619dc5caad4b5ebc318a?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt;) of a &lt;a href=&quot;http://www.reddit.com/r/web_design/comments/f6xff/html5js_pong_clock/&quot;&gt;JS + HTML5 Pong Clock&lt;/a&gt; into Chicken Scheme using the OpenGL + GLUT libraries. I couldn&amp;#39;t believe how smoothly it went, since it was a line by line port, the only thing I needed to write myself were the graphics drawing routines, easy enough since we&amp;#39;re only dealing with white rectangles after all, but now it functions as a cross platform screensaver (verified on Linux, OSX, and XP!).&lt;/p&gt;

&lt;p&gt;But the area I spend most of my time in is web development, so I was pleased to find the &lt;a href=&quot;http://wiki.call-cc.org/eggref/4/awful?action=show&quot;&gt;Awful framework&lt;/a&gt; for Chicken. Despite the name it is anything but. A simple usage example looks like this:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;scheme&quot;&gt;&lt;span class=&quot;c1&quot;&gt;;; Hello World!&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;awful&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;define-page&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;/&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;lambda &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;&amp;quot;Hello, World!&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Yes, it really is that easy. Of course you&amp;#39;ll most likely want to define your own template, and that is really easy to do too, my templates look something like this:&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>BLACK - Blog Engine</title>
      <link>http://demonastery.org/2010/12/black-blog-engine/</link>
      <pubDate>Thu, 30 Dec 2010 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2010/12/black-blog-engine</guid>
      <description>&lt;p&gt;As part of the migration of my blog to the Linode, I&amp;#39;ve cleaned up and restructured the code that powers this blog somewhat and made it available at &lt;a href=&quot;https://github.com/ZaneA/BLACK&quot; title=&quot;ZaneA/BLACK: Simple Blog Engine in PHP5.3.&quot;&gt;BLACK&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/583ce06565a8619dc5caad4b5ebc318a?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt; for others to use. Right now it is there more as a reason for me to keep improving it than anything else, since it needs some work.. but hopefully it will become useful enough for someone else to use it in the future.&lt;/p&gt;

&lt;p&gt;The &amp;quot;engine&amp;quot; revolves around the single function &amp;quot;post&amp;quot;. An example of its usage is below:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;black&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$query&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;($&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$issingle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  &amp;lt;a href=&amp;quot;/&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$post&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;id&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;/&amp;quot;&amp;gt;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$post&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;title&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  &amp;lt;br /&amp;gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  Posted on &lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;l, F jS Y&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$post&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;timestamp&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  &amp;lt;br /&amp;gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  Tags for this post are &lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$post&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;tags&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  &amp;lt;br /&amp;gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  Aaaannnd the post itself:&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  &amp;lt;br /&amp;gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$post&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;body&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  &amp;lt;br /&amp;gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$issingle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;     Viewing by post id, so insert Disqus commenting stuff here perhaps?&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;endif&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;})&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Added into an existing website template, the provided function will be called for each post you have, printing them all out to the page.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>New Server</title>
      <link>http://demonastery.org/2010/12/new-server/</link>
      <pubDate>Mon, 27 Dec 2010 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2010/12/new-server</guid>
      <description>&lt;p&gt;My blog has been migrated successfully to my Linode, which meant moving from one httpd (Apache) to another (Nginx), transferring MySQL data, and rewriting the rewrites ;)&lt;/p&gt;

&lt;p&gt;So far so good. I wasn&amp;#39;t expecting it to go smoothly at all. In celebration I&amp;#39;ve gone through my old posts and deleted or edited stuff that wasn&amp;#39;t really relevant or interesting. So hopefully the average post quality has increased a bit :)&lt;/p&gt;

&lt;p&gt;Cheers for now! And a belated Merry Christmas and Happy New Year to everyone!&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>My Linode Experience</title>
      <link>http://demonastery.org/2010/12/my-linode-experience/</link>
      <pubDate>Sun, 05 Dec 2010 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2010/12/my-linode-experience</guid>
      <description>&lt;p&gt;As mentioned in a previous post, I have been using a &lt;a href=&quot;http://www.linode.com/?r=57643aa6ca57ddd9b742224a9c028bc1fcd5ac2c&quot;&gt;Linode&lt;/a&gt; for the past few months and I just want to say that the experience I&amp;#39;ve had has been perfect. I purchased a &lt;strong&gt;Linode 512&lt;/strong&gt; and I&amp;#39;m using it to host a few small websites on a pretty generic &lt;a href=&quot;http://blog.rubynginx.com/index.php/2010_01_20/configure-your-linode/&quot;&gt;Nginx + PHP5.3 FastCGI stack&lt;/a&gt;, along with &lt;a href=&quot;http://library.linode.com/lemp-guides/ubuntu-10.04-lucid/&quot;&gt;MySQL&lt;/a&gt; and &lt;a href=&quot;http://library.linode.com/email/exim/send-only-mta-ubuntu-10.04-lucid&quot;&gt;Exim (as a send only MTA&lt;/a&gt;), and the whole setup sits comfortably in 50mb of memory and seems to perform well too (time will tell, I haven&amp;#39;t done any benchmarks). No special configuration has been needed other than setting up a basic directory layout for my &lt;a href=&quot;https://github.com/ZaneA/BDSM&quot; title=&quot;ZaneA/BDSM: Basically Deploy Sites using Makefiles.&quot;&gt;BDSM&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/583ce06565a8619dc5caad4b5ebc318a?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt; project, which takes care of pushing my websites from my development box.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/Linode_logo.jpeg&quot; alt=&quot;/images/Linode_logo.jpeg&quot;&gt;&lt;/p&gt;

&lt;p&gt;I would highly recommended &lt;a href=&quot;http://www.linode.com/?r=57643aa6ca57ddd9b742224a9c028bc1fcd5ac2c&quot;&gt;Linode&lt;/a&gt; to anyone looking for a VPS, the support is amazingly quick, and the uptime is great; and if you use my referral link to sign up I can get some extra credits, so that would of course be much appreciated :)&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>HashTWM Musings</title>
      <link>http://demonastery.org/2010/11/hashtwm-musings/</link>
      <pubDate>Sun, 07 Nov 2010 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2010/11/hashtwm-musings</guid>
      <description>&lt;p&gt;I know there has been a lot of requests for features to be implemented or fixed in &lt;a href=&quot;http://github.com/ZaneA/HashTWM&quot;&gt;HashTWM&lt;/a&gt;. But the reality is, I&amp;#39;m barely using Windows anymore and so I don&amp;#39;t have an urgent need for HashTWM.&lt;/p&gt;

&lt;p&gt;Despite all the progress around other tiling window managers for Windows I still believe there is room for improvement though, so I am putting some effort into getting a rewrite off the ground.
My idea is to get a solid foundation built up that (if anything) through the power of open source, someone will be able to take and hopefully build their dream TWM out of.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Sawfish and Emacs/org-mode</title>
      <link>http://demonastery.org/2010/10/sawfish-and-emacs-org-mode/</link>
      <pubDate>Wed, 27 Oct 2010 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2010/10/sawfish-and-emacs-org-mode</guid>
      <description>&lt;p&gt;Hi there, Today I&amp;#39;m going to write a small example on connecting the &lt;a href=&quot;http://sawfish.wikia.com&quot;&gt;Sawfish window manager&lt;/a&gt; to the &lt;a href=&quot;http://gnu.org/software/emacs&quot;&gt;Emacs text editor&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Why might you want to do this? Well mostly I just wanted to further my usage of Emacs, and thought the idea of being able to clock in and out of tasks in &lt;a href=&quot;http://orgmode.org&quot;&gt;org-mode&lt;/a&gt; whenever I change workspace or window would be pretty cool. Of course both Sawfish and Emacs make extensive use of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Lisp_(programming_language&quot;&gt;Lisp programming language&lt;/a&gt;) so it is a natural fit :)&lt;/p&gt;

&lt;p&gt;To start off, you&amp;#39;ll want to be using the Sawfish window manager, and you&amp;#39;ll want to have &lt;code&gt;emacs.jl&lt;/code&gt; somewhere in your lisp path. From there you can put something like the following in your &lt;code&gt;~/.sawfish/rc&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;cl&quot;&gt;&lt;span class=&quot;c1&quot;&gt;;; Require emacs.jl for emacs functions&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;&amp;#39;emacs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;;; Define a hook to be run on workspace change, utilizes the emacs-eval function defined in emacs.jl&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;my-enter-workspace-hook&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;emacs-eval&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;format&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;nil&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;(org-clock-in-on-workspace-change %S)&amp;quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;nth&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;current-workspace&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;workspace-names&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))))&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;;; Add our hook!&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;add-hook&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;&amp;#39;enter-workspace-hook&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;my-enter-workspace-hook&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;You will need to reload Sawfish for these changes to take effect (or you can eval them from Emacs).&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Scheme-to-PHP</title>
      <link>http://demonastery.org/2010/09/scheme-to-php/</link>
      <pubDate>Tue, 28 Sep 2010 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2010/09/scheme-to-php</guid>
      <description>&lt;p&gt;&lt;img src=&quot;/images/chicken.png&quot; alt=&quot;/images/chicken.png&quot;&gt;&lt;/p&gt;

&lt;p&gt;I&amp;#39;m writing this post to inform of my latest GitHub repo, &lt;a href=&quot;http://github.com/ZaneA/scheme-to-php&quot;&gt;Scheme-to-PHP&lt;/a&gt;, which contains the beginnings of a very very naive Scheme to PHP5 translator.
It will do so by implementing r4rs (or maybe r5rs) forms and macros in Scheme, that return the equivalent strings of PHP code, hopefully forming a working PHP script.
There will be a way of calling native PHP functions and classes, and Scheme functions such as &lt;code&gt;map&lt;/code&gt; will be mapped (no pun intended) to the equivalent PHP function (eg. &lt;code&gt;array_map&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;This is being written using &lt;a href=&quot;http://call-cc.org&quot;&gt;Chicken Scheme&lt;/a&gt;, which I&amp;#39;m currently spending most of my time hacking about with and is totally awesome :)&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>XMMSinatra</title>
      <link>http://demonastery.org/2010/09/xmmsinatra/</link>
      <pubDate>Fri, 10 Sep 2010 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2010/09/xmmsinatra</guid>
      <description>&lt;p&gt;Last night I released the first version of &lt;a href=&quot;http://github.com/ZaneA/XMMSinatra&quot;&gt;XMMSinatra&lt;/a&gt;, a tiny and minimal XMMS2 web client written in Sinatra (Ruby). You can find the code and a screenshot at the &lt;a href=&quot;http://github.com/ZaneA/XMMSinatra&quot;&gt;Github repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/images/xmmsinatra.png&quot;&gt;&lt;img src=&quot;/images/xmmsinatra_thumb.png&quot; alt=&quot;/images/xmmsinatra_thumb.png&quot;&gt;&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Hackfest Weekend</title>
      <link>http://demonastery.org/2010/09/hackfest-weekend/</link>
      <pubDate>Wed, 01 Sep 2010 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2010/09/hackfest-weekend</guid>
      <description>&lt;p&gt;Back from a really fun hacking weekend in Wellington, where I met some new people (and fellow hackers) and got to work on a project integrating &lt;a href=&quot;http://threadingbuildingblocks.org&quot;&gt;TBB&lt;/a&gt; further into the &lt;a href=&quot;http://github.com/facebook/hiphop-php&quot;&gt;HipHop-PHP&lt;/a&gt; compiler (and exposing it to PHP), which can be found at &lt;a href=&quot;http://github.com/OpenParallel&quot;&gt;Github&lt;/a&gt;. We made some pretty good progress and came up with a few pretty graphs.&lt;/p&gt;

&lt;p&gt;As mentioned in the last post, I have decided to purchase a &lt;a href=&quot;http://linode.com&quot;&gt;Linode VPS&lt;/a&gt; for a couple of months to try it out, and so far I am super impressed with the overall service. I will be using it mainly as a LNMP (Linux, Nginx, MySQL, PHP) host and so far it is doing the job well. I will also be spending the coming months looking further into &lt;a href=&quot;http://rubyonrails.org&quot;&gt;RoR&lt;/a&gt;, Perl, a couple of NoSQL servers (&lt;a href=&quot;http://couchdb.apache.org&quot;&gt;CouchDB&lt;/a&gt;, &lt;a href=&quot;http://code.google.com/p/redis/&quot;&gt;Redis&lt;/a&gt;), and maybe a message passing framework or two. This will also give me a chance to play around with some monitoring systems, and some deployment systems, such as &lt;a href=&quot;http://capify.org&quot;&gt;Capistrano&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As a side-note, anyone have any ideas of what to do with a bunch of Clickatell SMS credits? I have an account with plenty of credits but it&amp;#39;s sitting pretty stagnant at the moment.&lt;/p&gt;

&lt;p&gt;Also really looking forward to visiting Christchurch in the coming weeks. Haven&amp;#39;t been there in forever.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>ProtoIRC</title>
      <link>http://demonastery.org/2010/07/protoirc/</link>
      <pubDate>Fri, 09 Jul 2010 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2010/07/protoirc</guid>
      <description>&lt;p&gt;So I made a tiny and very hackable IRC bot/client base in PHP for rapid prototyping. Of course I threw it on &lt;a href=&quot;http://github.com/ZaneA/ProtoIRC&quot;&gt;GitHub&lt;/a&gt;. It makes heavy use of PHP &amp;gt;= 5.3 closure support as well as regular expressions for defining just about everything. Basic knowledge of the IRC protocol is recommended. You can find more information in the README file in the previous link.&lt;/p&gt;

&lt;p&gt;Here is an example of what a minimal bot looks like:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;protoirc.php&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$irc&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ProtoIRC&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;nick@hostname:6667&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;($&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;irc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;// This code will run on connect&lt;/span&gt;
        &lt;span class=&quot;nv&quot;&gt;$irc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;JOIN #channel&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$irc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/^:(.*)!~.* PRIVMSG (.*) :!echo (.*)/&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;($&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;irc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$nick&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$channel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;// Arguments are self documenting&lt;/span&gt;
        &lt;span class=&quot;nv&quot;&gt;$irc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$channel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Echoing &amp;#39;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$args&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;#39; for you &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$nick&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;green&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Also available is the ability to catch stdin, irc in, and irc out. Set up timers, and call functions asynchronously (fork/join).&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$irc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;go&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</description>
    </item>
      
    
      
    <item>
      <title>HashTWM Patch</title>
      <link>http://demonastery.org/2010/06/hashtwm-patch/</link>
      <pubDate>Wed, 23 Jun 2010 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2010/06/hashtwm-patch</guid>
      <description>&lt;p&gt;This morning I woke up to find a patch waiting for me on GitHub that extends &lt;a href=&quot;http://github.com/ZaneA/HashTWM&quot;&gt;HashTWM&lt;/a&gt;&amp;#39;s primitive tag support with what appears to be a more full featured, dwm-like tag support. Thanks to &lt;a href=&quot;http://github.com/gtellalov&quot;&gt;http://github.com/gtellalov&lt;/a&gt; for this patch :)&lt;/p&gt;

&lt;p&gt;This is the beauty of open source :D&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>LibOrgParser Update</title>
      <link>http://demonastery.org/2010/06/liborgparser-update/</link>
      <pubDate>Thu, 03 Jun 2010 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2010/06/liborgparser-update</guid>
      <description>&lt;p&gt;Today I brought my &lt;a href=&quot;http://github.com/ZaneA/LibOrgParser&quot;&gt;LibOrgParser&lt;/a&gt; repository up to date with my local copy, for the first time in a while since I&amp;#39;ve been rather slack with my local repository.. but hopefully I got everything. The new version brings reading and writing functionality, as well as a new API, and the OrgQL utility, which lets you run simple SQL like queries on an org-mode file, thanks to the SQLite library. Queries that look like this,&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;ALL&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;home&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;zanea&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;todo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;org&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;heading&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;CONTAINS&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;todo&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Oh and I found this image I made a while ago, kinda neat I think :)&lt;/p&gt;

&lt;p&gt;&lt;a href='/images/org-mode.jpg'&gt;&lt;img src='/images/org-mode_200x.jpg' /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add OrgQL to that, and that&amp;#39;s pretty much my todo list flow :)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; Oh and while we&amp;#39;re at it, here&amp;#39;s a one liner bash function for opening links in a file:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;k&quot;&gt;function &lt;/span&gt;nav&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; grep -ohE &lt;span class=&quot;s2&quot;&gt;&amp;quot;[[:alpha:]]*://[[:alnum:][:punct:]]*&amp;quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$@&lt;/span&gt; | &lt;span class=&quot;k&quot;&gt;while &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;read&lt;/span&gt;; &lt;span class=&quot;k&quot;&gt;do &lt;/span&gt;xdg-open &lt;span class=&quot;s2&quot;&gt;&amp;quot;$REPLY&amp;quot;&lt;/span&gt;; &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;; &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# use like this&lt;/span&gt;
nav todo.org someotherfile.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Misc Win32 Utilities</title>
      <link>http://demonastery.org/2010/06/misc-win32-utilities/</link>
      <pubDate>Tue, 01 Jun 2010 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2010/06/misc-win32-utilities</guid>
      <description>&lt;p&gt;Just created a new git repository on GitHub for my &lt;a href=&quot;http://github.com/ZaneA/Win32-Hacks&quot;&gt;Miscellaneous Win32 utilities&lt;/a&gt;. Right now it just has my ExplorerGestures code, but I will be adding some more utilities as I find them on my hard drive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; Added some more utilities. Probably still more to come..&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>PrepFS</title>
      <link>http://demonastery.org/2010/05/prepfs/</link>
      <pubDate>Mon, 31 May 2010 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2010/05/prepfs</guid>
      <description>&lt;p&gt;Been a while since I posted anything here, and it&amp;#39;s always good to have some fresh content, so I thought I&amp;#39;d post my latest creation PrepFS (Pre-process FS), a small utility FUSE filesystem, that enables preprocessing of files.&lt;/p&gt;

&lt;p&gt;My main motivation behind creating this, is enabling modified &lt;code&gt;.Xdefaults&lt;/code&gt; dependent on running window manager, or machine it is being viewed from. An Example of usage would be something like this:&lt;/p&gt;

&lt;h3&gt;~/.xinitrc&lt;/h3&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;wm&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; -e &lt;span class=&quot;s2&quot;&gt;&amp;quot;openbox\nxmonad&amp;quot;&lt;/span&gt; | dmenu&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;
prepfs ~/.dotfiles/prepfs -b ~/.dotfiles/real -pp &lt;span class=&quot;s2&quot;&gt;&amp;quot;gpp -D$wm -x \&amp;quot;%s\&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;exec&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$wm&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3&gt;~/.dotfiles/real/.Xdefaults&lt;/h3&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#ifdef openbox&lt;/span&gt;
    blah*blah: blah
&lt;span class=&quot;c&quot;&gt;#else&lt;/span&gt;
    this*stuff: here
&lt;span class=&quot;c&quot;&gt;#endif&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Then make sure &lt;code&gt;~/.Xdefaults&lt;/code&gt; is symlinked to &lt;code&gt;~/.dotfiles/prepfs/.Xdefaults&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;More information (including source) can be found here &lt;a href=&quot;http://bbs.archlinux.org/viewtopic.php?pid=576680&quot;&gt;http://bbs.archlinux.org/viewtopic.php?pid=576680&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>MPD Class for PHP</title>
      <link>http://demonastery.org/2010/05/mpd-class-for-php/</link>
      <pubDate>Mon, 31 May 2010 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2010/05/mpd-class-for-php</guid>
      <description>&lt;p&gt;I&amp;#39;ve just been going through a couple of folders and I found a very basic PHP class I wrote to control the &lt;a href=&quot;http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki&quot;&gt;Music Player Daemon&lt;/a&gt;. Assuming the text protocol hasn&amp;#39;t changed much it should still work fine :)&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt;/*&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt; * Base MPDControl Class&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt; * Provide functions for connecting and retrieving raw data from MPD&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt; */&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;MPDControl&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$hostname&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$port&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$timeout&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$socket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$errno&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$errstr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;MPDControl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$hostname&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;localhost&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$port&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;6600&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$timeout&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;hostname&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$hostname&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;port&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$port&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;timeout&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$timeout&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;connect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;socket&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;fsockopen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;hostname&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;port&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;errno&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;errstr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;timeout&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;socket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getData&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;disconnect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;sendRaw&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;close&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;fclose&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;socket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;getData&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nv&quot;&gt;$lines&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
        &lt;span class=&quot;nv&quot;&gt;$line&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;substr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$line&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;OK&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;substr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$line&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;ACK&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;nv&quot;&gt;$line&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;fgets&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;socket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;256&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;nv&quot;&gt;$lines&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$line&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;unset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$lines&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$lines&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$lines&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;sendRaw&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;fwrite&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;socket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$string&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</description>
    </item>
      
    
      
    <item>
      <title>ExplorerGestures</title>
      <link>http://demonastery.org/2009/10/explorergestures/</link>
      <pubDate>Sat, 03 Oct 2009 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2009/10/explorergestures</guid>
      <description>&lt;p&gt;So it&amp;#39;s &lt;strong&gt;2:56&lt;/strong&gt; in the AM and I&amp;#39;ve just hacked up a little app to enable moving up a directory in Windows Explorer by using the Thunar &lt;strong&gt;middle click + drag up&lt;/strong&gt; gesture. You can find it at &lt;a href=&quot;https://github.com/ZaneA/Win32-Hacks&quot; title=&quot;ZaneA/Win32-Hacks: Miscellaneous utilities in C using the Win32 API.&quot;&gt;Win32-Hacks&lt;/a&gt; &lt;img src=&quot;//www.gravatar.com/avatar/583ce06565a8619dc5caad4b5ebc318a?s=64&quot; style=&quot;position:relative;top:4px;border-radius:8px;width:16px;height:16px&quot; class=&quot;gravatar&quot; /&gt;.&lt;/p&gt;

&lt;p&gt;Enjoy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; This morning I&amp;#39;ve extended it to have left and right gestures to go backward and forward respectively just like Thunar and Nautilus. Down is used for exit rather than refresh as Windows seems to take care of this.&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Automatic agenda notification</title>
      <link>http://demonastery.org/2009/05/automatic-agenda-notification/</link>
      <pubDate>Sat, 02 May 2009 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2009/05/automatic-agenda-notification</guid>
      <description>&lt;p&gt;This article will show you how to utilize Emacs org-mode, python, a Nokia mobile (others may work too), and an SMS gateway like Clickatell, in order to receive a daily agenda that fits nicely into the phones calendar by using the vCalendar format. Yes that&amp;#39;s a fairly specialized combination, but hopefully will be useful to someone. I&amp;#39;m sure it&amp;#39;s possible to do the same using bluetooth instead of and SMS gateway, and I may update this to reflect that at some stage..&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>I can haz assembly!</title>
      <link>http://demonastery.org/2009/04/i-can-haz-assembly/</link>
      <pubDate>Mon, 20 Apr 2009 00:00:00 +1200</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2009/04/i-can-haz-assembly</guid>
      <description>&lt;p&gt;Simple CPUID, I also experimented with a version using an extra buffer variable and &lt;code&gt;printf&lt;/code&gt;.
It may not be much to others but I&amp;#39;m learning!&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;nasm&quot;&gt;&lt;span class=&quot;c1&quot;&gt;; CPUID&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;section&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;.data&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;buffer:&lt;/span&gt;         &lt;span class=&quot;kd&quot;&gt;db&lt;/span&gt;  &lt;span class=&quot;s&quot;&gt;&amp;quot;CPU Vendor ID: XXXXXXXXXXXX&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;bufferlen:&lt;/span&gt;      &lt;span class=&quot;nf&quot;&gt;equ&lt;/span&gt;     &lt;span class=&quot;kc&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;buffer&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;section&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;.text&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;global&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;_start&lt;/span&gt;

&lt;span class=&quot;nl&quot;&gt;_start:&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;     &lt;span class=&quot;nb&quot;&gt;eax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;          &lt;span class=&quot;c1&quot;&gt;; &amp;quot;Get maximum supported standard level and vendor ID string&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;CPU&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ID&lt;/span&gt;               &lt;span class=&quot;c1&quot;&gt;; Call CPUID&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;     &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;buffer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;ebx&lt;/span&gt;        &lt;span class=&quot;c1&quot;&gt;; Move 4 bytes from ebx to buffer+15&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;     &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;buffer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;19&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;edx&lt;/span&gt;        &lt;span class=&quot;c1&quot;&gt;; Move 4 bytes from edx to buffer+19&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;     &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;buffer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;23&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;ecx&lt;/span&gt;        &lt;span class=&quot;c1&quot;&gt;; Move 4 bytes from ecx to buffer+23&lt;/span&gt;

    &lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;     &lt;span class=&quot;nb&quot;&gt;eax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;          &lt;span class=&quot;c1&quot;&gt;; write syscall&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;     &lt;span class=&quot;nb&quot;&gt;ebx&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;          &lt;span class=&quot;c1&quot;&gt;; stdout&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;     &lt;span class=&quot;nb&quot;&gt;ecx&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;buffer&lt;/span&gt;             &lt;span class=&quot;c1&quot;&gt;; buffer&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;     &lt;span class=&quot;nb&quot;&gt;edx&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;bufferlen&lt;/span&gt;      &lt;span class=&quot;c1&quot;&gt;; size of buffer&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;int&lt;/span&gt;     &lt;span class=&quot;mh&quot;&gt;80h&lt;/span&gt;                 &lt;span class=&quot;c1&quot;&gt;; call kernel&lt;/span&gt;

&lt;span class=&quot;nl&quot;&gt;_exit:&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;     &lt;span class=&quot;nb&quot;&gt;eax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;          &lt;span class=&quot;c1&quot;&gt;; exit syscall&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;     &lt;span class=&quot;nb&quot;&gt;ebx&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;          &lt;span class=&quot;c1&quot;&gt;; Return 0&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;int&lt;/span&gt;     &lt;span class=&quot;mh&quot;&gt;80h&lt;/span&gt;                 &lt;span class=&quot;c1&quot;&gt;; call kernel&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</description>
    </item>
      
    
      
    <item>
      <title>A simple wallpaper wrapper</title>
      <link>http://demonastery.org/2009/03/a-simple-wallpaper-wrapper/</link>
      <pubDate>Fri, 13 Mar 2009 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2009/03/a-simple-wallpaper-wrapper</guid>
      <description>&lt;p&gt;Edit as necessary, requires hsetroot, mplayer, and a working xvidix on your graphics card (for video).&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/sh&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Set Wallpaper&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# If $1 is not empty&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; -n &lt;span class=&quot;s2&quot;&gt;&amp;quot;$1&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; ; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;    case&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;$1&amp;quot;&lt;/span&gt; in
      last&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;# Grab last set wallpaper from file and store in $WALL&lt;/span&gt;
        &lt;span class=&quot;nv&quot;&gt;WALL&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;cat ~/desktop/lastwall&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;
        ;;
      *&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;# Set $WALL from command line and write to file for future use&lt;/span&gt;
        &lt;span class=&quot;nv&quot;&gt;WALL&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt; &amp;gt; ~/desktop/lastwall
        ;;
    &lt;span class=&quot;k&quot;&gt;esac&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;    case&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;$WALL&amp;quot;&lt;/span&gt; in
        *.jpg|*.jpeg|*.png|*.gif|*.bmp&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;c&quot;&gt;# $WALL is an image file, so use hsetroot to set it as the background&lt;/span&gt;
            &lt;span class=&quot;nb&quot;&gt;echo &lt;/span&gt;Setting with hsetroot...
            hsetroot -full &lt;span class=&quot;s2&quot;&gt;&amp;quot;$WALL&amp;quot;&lt;/span&gt;
            ;;
        *&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;c&quot;&gt;# $WALL is likely not an image, so attempt to play with mplayer&lt;/span&gt;
            &lt;span class=&quot;nb&quot;&gt;echo &lt;/span&gt;Setting with mplayer...
            &lt;span class=&quot;c&quot;&gt;# Blank out background first&lt;/span&gt;
            hsetroot -solid &lt;span class=&quot;s2&quot;&gt;&amp;quot;#000000&amp;quot;&lt;/span&gt;
            &lt;span class=&quot;c&quot;&gt;# &amp;quot;Play&amp;quot; background using colorkey&lt;/span&gt;
            sudo mplayer -fs -vo xvidix -rootwin -colorkey 000000 -quiet &lt;span class=&quot;s2&quot;&gt;&amp;quot;$WALL&amp;quot;&lt;/span&gt; &amp;amp;
            ;;
    &lt;span class=&quot;k&quot;&gt;esac&lt;/span&gt;

    &lt;span class=&quot;c&quot;&gt;# Return good&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;exit &lt;/span&gt;0
&lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo &lt;/span&gt;Please specify an image or a video file to &lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt;, or use &lt;span class=&quot;s2&quot;&gt;&amp;quot;last&amp;quot;&lt;/span&gt;

    &lt;span class=&quot;c&quot;&gt;# Return bad&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;exit &lt;/span&gt;1
&lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;To use, run &lt;code&gt;setwallpaper.sh /path/to/image/or/video/file&lt;/code&gt; or &lt;code&gt;setwallpaper.sh last&lt;/code&gt;&lt;/p&gt;
</description>
    </item>
      
    
      
    <item>
      <title>Change fonts dynamically</title>
      <link>http://demonastery.org/2009/02/change-fonts-dynamically/</link>
      <pubDate>Wed, 18 Feb 2009 00:00:00 +1300</pubDate>
      <author>zane.a@demonastery.org (Zane Ashby)</author>
      <guid>http://demonastery.org/2009/02/change-fonts-dynamically</guid>
      <description>&lt;p&gt;After some Q and A on the ArchLinux forums, I am left with this in my .zshrc, the ability to change fonts on the fly:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;vim_font&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; -e &lt;span class=&quot;s1&quot;&gt;&amp;#39;\e]710;xft:Terminus:style=Regular\007&amp;#39;&lt;/span&gt;
    vim &lt;span class=&quot;nv&quot;&gt;$*&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; -e &lt;span class=&quot;s1&quot;&gt;&amp;#39;\e]710;xft:lime:style=Regular\007&amp;#39;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;vim&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;vim_font&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</description>
    </item>
      
    

  </channel> 
</rss>
