Emacs Erlang Snippets
Continuing with my previous yasnippet for Ruby, here are some snippets for Erlang mode.
Installation Create an erlang-mode directory under text-mode and save the following code in a file name mod.
#name : -module(). #contributor : hitesh <hitesh.jasani gmail.com> # – -module(${1:$(file-name-nondirectory (file-name-sans-extension (buffer-file-name)))}). $0 Save the following code in a file named exp.
#name : -export([]). #contributor : hitesh <hitesh.jasani gmail.com> # – -export([${1:start/0}]). $0 Save the following code in a file named imp.
Textmate Ruby Snippet to yasnippet
Dr. Nic recently put together a screencast of adding a Ruby snippet to TextMate. This particular snippet makes a class definition using the filename as the default classname. I always enjoy listening to Dr. Nic, so definitely check out the ‘cast.
I used to love TextMate, but I can’t use it anymore since I’m working on multiple platforms. Emacs is my editor of choice now and I can’t say that I’m missing anything.
Initial Release of hsparklines 0.1.0
Update: Source code is available on github.
I’ve put the first release of hsparklines up on Hackage. It’s a sparklines library implemented in Haskell. I know there are a number of web service based solutions that one could use for this, but for those who’ve used web services, you know that there are some things you want to keep local.
If you haven’t played with sparklines yet, you should. They’re minigraphs inspired by Edward Tufte to present a large amount of contextual information in a minimum of space.
Command Line Haskell and Error Handling Examples
I was working with using Haskell on the command line recently and it occurred to me that it might be interesting to demo it and walk through some error handling scenarios at the same time.
Like Perl, Python and Ruby you can invoke ghc on the command line to run programs on the fly. Yes, Haskell makes for a good scripting language.
Let’s say we have a column of numbers that we want to add up.
Haskell, HDBC and SQLite
The current set of database driver libraries in Haskell are written by some very talented people, but even then, the libraries sometimes have some rough edges that make them difficult to use for the average web app developer. In fact the frustration level can be high enough that some have given up trying to work with them.
Recently I was working with John Goerzen’s HDBC library (1.1.4). I don’t remember having any problems installing it or the additional library I grabbed from darcs to run with Sqlite3.