-
sorting null values last in CakePHP
Assume your data contain a field with some NULL and some not NULL values. If you want to sort your entries against that field in a descending order, NULL is interpreted as 0 and entries with NULL in that field go at the bottom. This is perfectly desirable. But what if you want to sort them into an ascending order? Entries with the NULL field would show up first. In some cases, you might want to sort entries with actual data in that field first, and let the rest show up last.
-
generate jekyll front-matter with bash
Creating a post in a jekyll-powered blog is pretty straightforward. Just create a file in markdown format and put your post in. Every post has a special YAML Front Matter block with some variables. Using a bash script we can easily generate this file with proper values for the YAML variables. For example, for this post, the filename contains the post date and title.
-
weechat horizontal buffers bar
To get a nice clean buffer bar at the bottom of the screen you need the buffers.pl script.
-
datetime to timestamp in python
Say you got a file’s last update time, using the stat command
>>> import os >>> disk_ts = os.stat('filename').st_ctime >>> disk_ts 1303113637.0
-
Archlinux presentation @ Openfest 2011
You can find here the Archlinux presentation I made with Evangelos Balaskas at Openfest 2011.