According to Cordell

Setting up authentication on a Grape API with GrapeTokenAuth

Grape is a fantastic framework for building an API. Of course, one of the most fundamental aspects of any API is authentication. The grape_token_auth gem is approaching its first major release (0.1.0) and this will provide a “getting started” guide. In this post, we will walk through setting up …

Better Fuzzy Search with Ctrl-P in Vim

For those familiar with Sublime Text and have since moved to vim you probably miss the Cmd+P feature that allowed you to find a file in your working directory through a fuzzy match. The two main plugin contenders for fuzzy file finding in vim would arguably be Ctrl-P and Command-T. Personally I perfer Ctrl-P because it …

Prime Factor Problem Cheat Sheets

1 is not a prime number. A prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself. – Wikipedia Finding Prime Numbers Sieve of Eratosthenes A basic implementation of the sieve of Eratoshenes I wrote: def primes(max_value) search_space = …

API with Padrino and Grape

Recently, I have been exploring options for creating RESTful APIs in the Ruby. Concurrently, I have been investigating Sinatra and its father-framework padrino to create a lighter weight web app. While Sinatra in itself is a suitable solution for APIs, grape is a micro-framework specifically geared towards creating …

REST API and related object creation

While building a REST API I began examining th issue of creating child objects that do not already have a parent object created. Consider the following scenario: Books have one author and author’s have many books. What happens when you want to add a book but have not yet created the author resource. Further, what …

Quick fixup in Vim with fugitive

I am a huge fan of Tim Pope’s fugitive git plugin for Vim. I rarely have to drop out of vim to do any git related functions. However, I found that --fixup is not well supported in fugitive, but can be easily be achieved. One of my workflows with git is to add fixup commits whenever I am doing revisions due to …

Automating the start and end of your work day

You probably do the same thing when you arrive every morning at the office if you are a developer. Fire up your editor, open your chat program, probably a console or two. At the end of the day you probably shut all of that down, and it is a pretty stable and recurrent flow, which means that it can be automated! As an …

Getting Started with Slate

Slate is an open source window management tool geared towards power users. It obviates the use of many paid tool such as Divvy and Stay. I am a long time Divvy user and was considering using Stay to manage window arrangements, until I found Slate. Slate is configured through a .slate file that will be familiar to users …

Ubuntu 14.04 and Compiling Ruby 2.X

While trying to set up a VPS running Ubuntu 14.04 I was unable to compile Ruby 2.1.1 (which was the current version). I kept running into errors such as: readline.c:1977:26: error: ‘Function’ undeclared ... The cause is that Ubuntu 14.04 ships with Readline version 6.3 which apparently breaks builds of Ruby and Python. …

Compelling People Book Review

Compelling people: The Hidden Qualities That Make Us Influential exists in the rarefied air of self-help books that might actually help you. Most books of these type contain a thesis statement that you understand within the first 40 pages. The next X number of pages are the author(s) filling out their quota for his or …

Pages