Reading List

The most recent articles from a list of feeds I subscribe to.

Writing Haskell with Vim

Getting started writing any new language is easier with the help of your editor. In the case of linters, they can teach you the language’s idioms and best practices while you write your first lines of code. Here’s how to set up a new project in Haskell and configure vim for Haskell. Basic vim setup for Haskell What you’re going to need: Vim 8 Your .vimrc A vim package manager (here I use vundle) Airline (Vim status bar) ALE (Linting engine) ghcmod-vim (Reveal types inline) Haskell / ghc Stack ghc-mod, hlint, hdevtools, hfmt This tutorial assumes you already have Vim 8 installed.

How to manage or eliminate React state without Redux

When I started writing React – I made a big mess. Many of my components took too many props, or my component had an immense amount of state. Doing simple things required a lot of data manipulation, and ultimately led to a lot of bugs. It didn’t take long for simple tasks to become extremely tedious. I think this happens to a lot of people who start out with React. It’s almost too easy to write a lot of code, when in reality, the answer may be that less is more.

Converting an Angular.js app from Require.js to Webpack

I’ve recently converted my webapp at work from Require.js to webpack, and although the initial setup was a little tricky, it clearly offers numerous benefits to make the switch when it comes to performance, loading times, and development workflow. In this post, I will only cover a basic switch from Require.js to Webpack. In a following post, I’ll go into lazy-loading with webpack and ui-router. Possible Require.js setups, and their pitfalls In essence, there are two basic setups you can have for your Require.

Karma tests with AngularJS + RequireJS

Setting up testing is usually a little painful – but setting up testing when you’re using some kind of weird Angular + Require setup is even worse! Furthermore, the Karma documentation is a little bit terse, so it’s hard to tell exactly what combination of configuration settings will get you your intended result. Here’s how I accomplished this. File Hierarchy Here is a typical, sample hierarchy. My top-level directory is something like /opt/some-app.

Django Tastypie: Tips, Tricks, and Troubleshooting

Tastypie is one of the most popular REST API frameworks for Django, and surprisingly easy to get up and running if you’re already working with Django’s Models. It can, however, be a bit difficult to debug, and produce some cryptic error messages. Here are a couple of tasks I’ve had to figure out while working with this framework, tips for troubleshooting, and some general reflections. Table of Contents Adding Fields to a Resource Mapping Attributes of an Object through a Reverse Relationship Filtering via Through Relationships Self-Referential Resources Adding Fields to a Resource It seems simple enough – and it is – but there are really a number of ways to do it, so you have to decide which is most appropriate for your use case.