Content tagged projects

Yoshi Theme 6

Published on:

According to github I released version 6 of my Yoshi theme 8 days ago. Consequently I uploaded it to Marmalade. I felt I should mention that, and it also gives me an excuse to write something.

This new version brings a newly added CHANGELOG, inspired by Keep a CHANGELOG. It doesn't completely follow the format suggested in there because it's in Org mode format and because I felt I could style this format better than the one they propose, at least when using Org mode. I still need to export it to somewhere nice.

Since the last release, which I don't think anyone has ever seen, there have been some major changes in magit's faces, so those have been added. The original ones are also still there in the hopes that anyone using an older version will still have nice colors.

I've also removed some color variations because I felt they were impurities in the theme. I don't think they actually bring anything to the table and it looks cleaner with just the basic set of colors.

If you have any suggestions, wishes, questions or insults you want to throw my way, please do so in the issue tracker.


Introducing ox-coleslaw

Published on:

I have a big problem: I can't write a blog in anything other than Org mode. I have another problem: I haven't found a good way to write a blog only in Org mode. This always keeps me going back and forth between blogging systems. I've used tekuti, WordPress, and I've tried a few others. Currently I'm using Coleslaw. I haven't written anything lately though because it supports Markdown and HTML and I was getting antsy for some Org mode again. So I've been on the lookout for something new.

Well… I've had enough. I'm not going away this time. I'm going to fix my problems and commit to this system. I picked Coleslaw because it's written en Common Lisp and has some interesting features. I'm going to write an exporter for org to whatever Coleslaw needs!

I've known that it's pretty easy to write an exporter for Org mode for some time, but I've never actually tried to write one. I modified some bits and bobs on org-blog, but that didn't really work out. Today though, while reading an old(er) post on Endless Parentheses, I ran into ox-jekyll. Jekyll has a pretty similar page/post definition syntax to Coleslaw, so it seemed easy to read what they're doing and copy the relevant parts. It's a very small Emacs Lisp file, which made it very easy. So congrats to them and the people writing Org mode for making some very clear code.

So I wrote (or copied) ox-coleslaw based on ox-jekyll. It's slightly smaller than ox-jekyll because, frankly, it offers less. I just need a simple way to export a .org file to a .post file, nothing fancy.

To write posts I will use Org mode. Once ox-coleslaw is loaded I use the org export function to export it to an HTML file with the proper header. You can also do this non-interactively from, for example, a Makefile, but that is a story for another time.

This document is the first attempt at publishing a blog post using ox-coleslaw.


Small Recent Posts

Published on:

I've been reading Professional WordPress Plugin Development the last few weeks and I finally got around to putting some of what I've read (a tiny bit) to use.

I've written my first WordPress plugin. It's part of a larger project of mine to replace my [[http://orgmode.org]] powered static site with WordPress and learn about WordPress plugin development along the way.

Right now, it only shows the 5 latest posts, much like the widgets in the side-bar and admin area do (except with less options I'm sure). My plans are simple, just a number of posts and possibly a tag or category.

For now I don't have any place for you to see it in action, but hopefully soon. To use it just add [[recent]] anywhere in your post or page. It is meant to be used in pages, but there is no technical reason why it couldn't also be used in posts.


Testing with Lua

Published on:

Last time I wrote about my project avandu-lua and I mentioned how I was having some trouble testing the different types of functions. I've since found a way to mock the functions in such a way that I can safely test functions with IO operations without having to actually perform them. It seems that Lua modules are mutable. Perhaps this isn't strange given that Lua modules are basically tables, but I hadn't considered it before. I'm not entirely sure if it is a language feature or just something that happens to be true right now, so this method of mine might soon become useless.

Testing operations

So, to test these functions that would normally have side-effects or would require a lot of extra work setting up to work correctly, we basically have to replace the existing functions. Normally in a running program you really wouldn't want to do this, save for when you have dynamic scope, which I haven't yet found in Lua.

So I want to test that everything works properly when the io.access function reports it can't access a certain file, I'd change the function like so:

-- You must first require it, so you have the same module.
local posix = require 'posix'

-- ...

posix.access = function ()
   return false
end

This way I know what the function will do, when it eventually gets called.

Travis-CI

After finally getting some tests in my project and making sure that I have full test coverage of my module, I thought it would be fun to see if I could automatically test everything with travis-ci. It was a little challenging because I don't normally run Ubuntu or Debian, so I don't know what they name their packages, and one of my dependencies (luasec) had some trouble finding the libssl library.

After a little poking around, a few retries and a false-success, it's now finally running:

My .travis.yml is pretty simple:

language: erlang

env:
  - LUA="lua"

branches:
  except:
    - gh-pages

install:
  - sudo apt-get update
  - sudo apt-get install luarocks libssl1.0.0
  - sudo luarocks install busted
  - sudo luarocks install luasocket
  - sudo luarocks install luasec OPENSSL_LIBDIR=/usr/lib/x86_64-linux-gnu
  - sudo luarocks install luajson
  - sudo luarocks install luaposix

script: "busted -m 'lua/?.lua' -o TAP"

# ...

I'm using the erlang environment, because there isn't a Lua one (yet). I've written my library for lua, not luajit, so busted needs to know which to run, it always runs luajit first it seems. I don't need the tests to be run again when the gh-pages branch is updated, since that has nothing to do with the code itself, I would actually like to have tests run on all other branches.

Then we get to the dependencies. Nothing major except for the luasec dependency. I'm not entirely sure how long that OPENSSL_LIBDIR will remain where it is now, but it works for now. I didn't discover the location myself, I found it on someone else's .travis.yml as a comment.

Lastly we have the script. Since the tests live in /spec and the code lives in /lua I run the tests from the project root and include the lua directory in the module path. I use TAP output because with the default output failures also return 0, when a failure occurs with the TAP output, a non-0 exit status is returned and travis knows they didn't pass. That is why build 6 passed even though there was still a failed test.

The rest is notification settings which isn't interesting enough to duplicate here.

Still to do

Now I should start expanding it a little. Well, actually I still need to add the proper license information.


Avandu in Lua

Published on:

A little while ago I started using the Awesome window manager again. I've started to play some PC games (such as Rogue Legacy) and have to use some more graphical applications again. Stumpwm just wasn't quite cutting it and suddenly it seemed that my workflow didn't quite fit with a completely-manual tiling experience.

So now that I'm back with Awesome I wanted to have a count of the number of unread articles in Tiny Tiny RSS in my wibox. I already have a project named avandu, which is an Emacs interface for Tiny Tiny RSS, and for a little while I used that in combination with Emacs' daemon mode to get the number of unread RSS items. This halt my Emacs for a few seconds every minute, though, so that was unpleasant. It also caused a lot of "Connecting to host: ..." messages to appear in my Emacs' echo area, which is a little annoying.

So I decided to write a lua module to get this count, since I didn't have a lua project yet. That is avandu-lua. Right now it only implements a login and unread functions, which allow you to log-in to get a session key (so you can do other things), and get the number of unread articles (what a shock!).

I've written a bit of documentation for it, hosted by github. There isn't much to document of course, but I try.

I still need to add tests, but I'm having difficulty deciding on how to do this. busted looks really nice, but their idea of stubs and mocks doesn't seem to be very useful if you're testing a function that calls, for example, http.call, which returns 4 distinct values, not none. I can't decide if I should keep looking, (try to) write something or use _TEST checks everywhere. I'm leaning towards that last one, perhaps I'll add that.

I don't currently have any concrete plans of extending it to have more functions than the ones I've added so far, I might do it for fun at some point, or if you'd really like to be able to call Tiny Tiny RSS from lua let me know and I might put some more effort into it.

It's been nice to work with lua. I don't particularly love the language and it certainly doesn't beat Lisp on any front, but it has its moments and niceties.

Some things that still need to be done:

  • As I said, I need to add tests.

  • I think I should try to see if coroutines can be used, it seems to hang Awesome now on occasion.

  • Add license info. Yeah I really should almost do this before I do anything else when I start a new project. It's going to be LLGPL in any case.

  • Release an actual version. Always installing from just a git checkout can be a little annoying.


CLark 0.1.0

Published on:

A few days ago I tagged CLark 0.1.0.

CLark is a Common Lisp rewrite of my Markam project, which in turn was a Chicken Scheme rewrite of linkwave. With each rewrite I come a step closer to having the program that I need. Linkwave could only store bookmarks, Markam could also search through them and had a conkeror interface which allowed adding and searching through bookmarks. Now CLark expands upon this by allowing users to edit their bookmark's information, changing the tags, removing bookmarks, writing their own commands, an improved command-line interface and bookmark status checking (bookmarked or not). It also adds commands to conkeror for the data manipulation commands that are new (edit, set-tags, remove) and a mode-line indicator of bookmarked status.

For now it only targets SBCL, but I'm not averse to including others.

The next big step should be adding a mcclim-based GUI for those crazy people who don't like to use the command line.


Markam v0.2.0

Published on:

I've just pushed version 0.2.0 of my project Markam. It took longer than I thought it would. Since storing was still all I wanted to do I had no rush to add anything else. Until now.

Changes include:

  • Add install, uninstall and install-strip targets to the Makefile, this should make installing easier.

  • Add simple tag/title searching. Looks through bookmarks for any that have been tagged with the given string, or that have it somewhere in their title.

  • Add a --script switch, which changes output for both the default and search behavior. When this switch is passed to markam it outputs the name, description and url of each bookmark, where each bookmark is separated by C-^ (Record separator) and each field by C-_ (Unit separator). This should help in building tools around it by making parsing somewhat easier. The bundled Conkeror interface uses it.

  • Update the Conkeror interface:

    • Add the commands markam-find-url and markam-find-url-new-buffer. These call markam with a possible search string and add them as completion candidates, for easy searching and opening of your bookmarks. markam-find-url uses the current buffer and markam-find-url-new-buffer opens the url in a new buffer.

dispass.el features

Published on:

Today I've added 3 new features to dispass.el:

  • Add support for different algorithms.
  • Add support for different sequence numbers.
  • Add support for different labelfiles.

With these changes the functionality offered in dispass.el should be on-par with the ones found in DisPass, which is a nice milestone.

There is one little bug that we're both working on at the moment, if you have a label that is also a substring of one of your other labels it won't work in dispass.el, but we're working on fixing this case in DisPass.

Now we wait untill DisPass gets another release and as of then we will try and keep up with both the stable releases of DisPass and the development version.


This blog covers archlinux, avandu, avandu-lua, cask, ci, clark, common-lisp, config, conkeror, diff, dispass, dispass.el, editors, elisp, emacs, eshell, evil, exherbo, experiments, file-synchronization, games, git, github, gnus, hla, html, javascript, lisp, lua, markam, meta, mpd, notion, org-mode, ox-coleslaw, projects, rc, sbcl, small-recent-posts, software, stumpwm, systemd, tasks, tekuti, testing, tips, todo, ttrss, utility, vagrant, vc, vim, visual, wdocker docker docker-compose, wm, wordpress, yoshi-theme

View content from 2016-02, 2015-09, 2015-08, 2014-12, 2014-10, 2014-08, 2014-07, 2014-06, 2014-04, 2014-01, 2013-11, 2013-10, 2013-08, 2013-05, 2013-04, 2013-02, 2013-01