I was reading SQL antipatterns and got into the chapter about recursive queries and how there are different ways to approach this. I wanted to experiment with this and found that postgresql supports recursive queries. I decided to make a simple commenting database and see how it would work.
All articles
TaskLite Setup
I used vimwiki for task management, with a couple of custom snippets and scripts, but this quickly became complicated. I needed another tool that would be easy to use, easy to understand and easy to tweak. TaskLite fit these conditions perfectly:
- It's build on haskell and sqlite, a language and …
Copying Pass Secrets to Another Machine
I had a new laptop but couldn't access my previous one, so I had to figure out how to get my pass secrets. I had these problems:
- How would I get my old password store?
- How would I be able get my old gpg keys into this new laptop?
- I …
Thinkpad T440 ArchLinux Setup
I recently got a Thinkpad T440 and decided to document the steps I took to set up archlinux. The last time I'd done this was on the Asus Zenbook UX330UA some years back. I thought the process would be different, but it was largely similar.
I first got the iso …
Setting up Hspec on a Haskell Project
I'd started the Kindle-Highlights project without tests. This was a problem because I couldn't add features as fast as I wanted because I'd break something without knowing. I needed to add tests to speed up my development. For haskell, hspec is a tool/library for this. Setting this up on …
Custom snippets in vim
Set up
I use ultisnips for my snippets. To set this up, I have this in vimrc:
call plug#begin('~/.vim/plugged')
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' " Snippet support
call plug#end()
let g:UltiSnipsExpandTrigger="<c-e>" " Default is <tab>
let g:UltiSnipsEditSplit="vertical"
let g:UltiSnipsSnippetDirectories=["UltiSnips", "mysnippets"]
This …
First Haskell Parser (for Kindle Highlights)
Kindle saves highlights, bookmarks and notes in a My Clippings.txt file. I needed a way to parse it and filter out the content I wanted. I also wanted to work on a parser in haskell, so this was a great opportunity to get my hands dirty.
I used stack …
Hiding Toolbars in Firefox
While using i3, I've realized that a lot of screen real estate in firefox is taken up with the tab and navigation bar. This isn't a problem when its the only application open, but when some tiling has been done, these two bars quickly become a barrier to usage, for …
Python Timeit with Partial
The timeit module provides an easy way to time python code. I use it to check if a new code implementation runs faster than an older implementation.
Example usage of this is:
import timeit
timeit.timeit('list(range(100))')
def greet():
print('Hello World')
timeit.timeit(greet, number=4)
Timeit …
Working With A Bad Codebase
I've worked with codebases that have made me frustrated. Some of the **features** I've seen include:
- Naming the variables returned by a function $this and $return.
- Having different languages in the same project. For example, I got one which had PHP, Python, Perl, JavaScript (node in the backend) and c …