<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>gist on keyes.ie</title>
    <link>https://keyes.ie/tags/gist/</link>
    <description>Recent content in gist on keyes.ie</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Sat, 09 Mar 2013 00:00:00 +0000</lastBuildDate>
    
	<atom:link href="https://keyes.ie/tags/gist/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>WIP: Python Markdown prettypre extension</title>
      <link>https://keyes.ie/wip-python-markdown-prettypre-extension/</link>
      <pubDate>Sat, 09 Mar 2013 00:00:00 +0000</pubDate>
      
      <guid>https://keyes.ie/wip-python-markdown-prettypre-extension/</guid>
      <description>Update 03/09 16:23: *I just discovered CodeHilite which uses Pygments to markup the code for highlighting. Removing my solution’s JavaScript dependency is a nice win. *
I’ve been working on a documentation tool as a side-project and one of the aims is to use Markdown as the source format. It’s nice when code snippets are syntax highlighted in documentation so I am working on a Python Markdown extension to enable that, without introducing too much of a burden on the document author.</description>
    </item>
    
    <item>
      <title>Hyperlinks with Unicode in ReST</title>
      <link>https://keyes.ie/hyperlinks-with-unicode-in-rest/</link>
      <pubDate>Wed, 28 Nov 2012 00:00:00 +0000</pubDate>
      
      <guid>https://keyes.ie/hyperlinks-with-unicode-in-rest/</guid>
      <description>I noticed the following “challenge” on Twitter last night:
 Challenge: Figure out how to create a hyperlink for the text “Acme™” without using the literal character “™” in ReST. Prize for the winner.
 In the oft-repeated words of Barney Stinson, challenge accepted:
|Acme(TM)|_.. |Acme(TM)| unicode:: Acme U+2122.. _Acme(TM): http://example.com Visit the Gist to see the rendered output.</description>
    </item>
    
    <item>
      <title>Automatically compile LESS files</title>
      <link>https://keyes.ie/automatically-compile-less-files/</link>
      <pubDate>Mon, 26 Sep 2011 00:00:00 +0000</pubDate>
      
      <guid>https://keyes.ie/automatically-compile-less-files/</guid>
      <description>A nice feature of Compass is that it provides a watch command line option. When you pass this option, compass automatically compiles SASS files when they are saved.
LESS doesn’t provide a similar option, so I created lesswatch.
It uses watchdog’s watchmedo script, which can run a command when a file change is detected. watchdog is implemented in Python and can be installed from PyPi. Compilation from LESS to CSS is performed by lessc.</description>
    </item>
    
    <item>
      <title>Extracting values from a Cherokee configuration file</title>
      <link>https://keyes.ie/extracting-values-from-a-cherokee-configuration-file/</link>
      <pubDate>Thu, 16 Jun 2011 00:00:00 +0000</pubDate>
      
      <guid>https://keyes.ie/extracting-values-from-a-cherokee-configuration-file/</guid>
      <description>I need to extract the maximum vserver id and the maximum source id from a Cherokee configuration file, so I can auto-generate configuration for test instances. The following is the solution I came up with:
import os import re def increpl(matchobj): &amp;#34;&amp;#34;&amp;#34;Replace the include statement with the content of the file.&amp;#34;&amp;#34;&amp;#34; inc = matchobj.group(1) return parse(inc) def parse(filename): &amp;#34;&amp;#34;&amp;#34;Returns the configuration with all includes resolved.&amp;#34;&amp;#34;&amp;#34; cfile = open(filename, &amp;#39;r&amp;#39;) content = cfile.</description>
    </item>
    
    <item>
      <title>Find a random unbound port</title>
      <link>https://keyes.ie/find-a-random-unbound-port/</link>
      <pubDate>Thu, 16 Jun 2011 00:00:00 +0000</pubDate>
      
      <guid>https://keyes.ie/find-a-random-unbound-port/</guid>
      <description>find_unbound_port returns a (pseudo-)random unbound port on localhost.
import random import socket # range of ports where available ports can be found PORT_RANGE = [33000,60000] def find_unbound_port(): &amp;#34;&amp;#34;&amp;#34;Returns an unbound port number on 127.0.0.1.&amp;#34;&amp;#34;&amp;#34; port = random.randint(*PORT_RANGE) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: sock.bind((&amp;#34;127.0.0.1&amp;#34;, port)) except socket.error: port = get_port() return port if __name__ == &amp;#34;__main__&amp;#34;: print find_unbound_port() </description>
    </item>
    
    <item>
      <title>GitHub Gists</title>
      <link>https://keyes.ie/github-gists/</link>
      <pubDate>Thu, 15 Apr 2010 00:00:00 +0000</pubDate>
      
      <guid>https://keyes.ie/github-gists/</guid>
      <description>I discovered GitHub Gists today, so I decided to share a tiny function (Python) I wrote today to get the latest revision identifier for a git or svn sourcepool. A zero tests, zero edge cases, suck it and see approach to releasing little bits of code.</description>
    </item>
    
  </channel>
</rss>