サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
Pixel 9
jeffkreeftmeijer.com
Instead of configuring colors separately for both Vim and the rest of the terminal, limiting Vim’s color scheme to 16 ANSI colors allows setting all color preferences in the terminal’s theme. Doing so results in consistent colors among terminal utilities and a color theme that’s quick to swap out for another one. Figure 1: Vim and a git log side by side in tmux in Terminal.app. By using Dim as Vim
Vim doesn’t show line numbers by default, but they can be turned on in your configuration. Besides regular absolute line numbers, Vim has relative and “hybrid” modes to help navigate around files. With the vim-numbertoggle plugin, it can even toggle between line number modes automatically when you switch files or enter insert mode. Absolute line numbers Using the number option, Vim sets up absolut
Method chaining is a convenient way to build up complex queries, which are then lazily executed when needed. Within the chain, a single object is updated and passed from one method to the next, until it’s finally transformed into its output value. Object-relational mappers like Rails’ ActiveRecord use method chaining in their query interfaces to build up a database query by accepting multiple find
A project I’m working on required a score to be calculated on an ActiveRecord model, and stored in the database. The User#calculate_score method calculates the score: In ActiveRecord models, a convention is that methods that update the database should have a bang, or an exclamation point appended to their names. To add a function that stores the score, we add User#calculate_score!:
I’m a little behind on my blog feeds, so I didn’t read Collective Idea’s article about json_spec until yesterday. They created a gem which provides some RSpec matchers and Cucumber steps to do JSON API testing, since “They can be a joy to build but a pain to test”. In this article, I want to take a step back and see exactly how painful it is to test a JSON API. Since I don’t agree that testing an
By Jeff Kreeftmeijer on 2011-04-18 (last updated on 2018-11-05) I’m sure you’ve seen the image view modes Github released last month. It’s a really nice way to see the differences between two versions of an image. In this article, I’ll try to explain how an image diff could be built using pure Ruby and ChunkyPNG. If you need a more basic introduction to working with pixel data in ChunkyPNG, check
Over the last few weeks, I’ve become increasingly interested in computer vision. After finally getting OpenCV running, playing around with a little face detection and searching for solutions to weird problems that occurred, I decided to dive a bit deeper into computer vision to figure out how it actually works. I started out with blob detection, which simply means detecting, locating and measuring
I’ve been using Steak for almost a year now. It’s an RSpec extension by @cavalle to allow you to get up and running doing acceptance testing. Since then I wrote and talked about it a lot and it definitely helped me to get into acceptance testing without having to get out of RSpec and writing tests in English. What a lot of people don’t know is that Steak is nothing more than a bunch of aliases and
tl;dr Check out stillmaintained.com to create some nice maintenance status pages for your Github projects. Back when it was still nice and sunny outside, I wrote an article about abandoned open source projects, in which I proposed a way to mark Github projects as abandoned. There was some discussion and a feature request, but nobody seemed to have nice and clean enough solution that solved the pro
By Jeff Kreeftmeijer on 2010-11-15 (last updated on 2018-11-06) As you might have noticed, I’ve been spending some time trying to get running test suites with RSpec a bit better and faster over the last weeks. This week I looked into RSpec’s formatters. Aside from the red “F” RSpec will output when a spec fails, there’s no direct feedback that allows you to go fix things immediately. You’ll simply
Stop RSpec on the first failure with the --fail-fast command line option When running a project’s RSpec test suite locally, have RSpec automatically stop on the first test failure with the --fail-fast command-line option1. ...............................F Failures: 1) Example divides the dividend by the divisor Failure/Error: expect(dividend / divisor).to eq(21) TypeError: nil can't be coerced in
Swinger is not maintained anymore, since its functionality is built into Capybara. Check out Capybara ate Swinger for more information. If you’ve been doing the acceptance testing dance for a while, you probably know it can get slow pretty fast. Not necessarily in every driver, but since you wanted awesome javascript stuff in your application you’ve equipped Capybara with Selenium to actually run
Setting up MongoDB, MongoMapper, GridFS, Devise & Carrierwave on OSX@matsimitsu Sorry, this article is a bit outdated. Lucky for you, @antekpiechnik wrote a really nice guide in which he uses Mongoid and Rails 3. Be sure to check that out too! For a little side project I wanted to experiment with MongoDB and GridFS on Rails 2.3.5, but it took me a while to get everything up and running. It wasn’t
Last week I released an article on git-flow, a tool that helps you keep your Git repositories organized. Today I’d like to explain some things that tend to annoy me while working with other people and using Git. This article possibly won’t tell you anything you didn’t know already, but I just wanted to get this out there and tell you some things that I think would make working with Git a bit more
Vincent Driessen’s “git flow” branching model is a git branching and release management workflow that helps developers keep track of features, hotfixes, and releases in bigger software projects. This workflow involves many commands to type and remember. The git-flow library of git subcommands can help by automating some parts of the flow to make working with it easier. After installing git-flow1,
If you see extra mouse cursors moving around: don’t worry, they’re part of the demo. You can always disable them if you want. I’ve written a follow-up on this article, in which I improved a lot of the code. Be sure to read that one too! If you’re using a browser that supports web sockets, you might see some extra mouse cursors moving around. These are actually other people also looking at this pag
In version 0.2.1, Navvy introduced a really simple Daemon script to allow users to run Navvy’s worker in the background. While some people asked for this, you might argue that running rake navvy:work & would do the exact same thing. It runs the worker, like the rake task does. It only does it in the background, like rake’s & argument does. To try and get some more control over my Worker process, I
Capybara has an RSpec DSL now, allowing you to steak-acceptance testing without Steak. Be sure to read Acceptance testing using Capybara’s new RSpec DSL too. I’m not going to tell you why you should write acceptance (or integration) tests, but you should. I used Cucumber for a while now and I love it, but I think writing my tests in a business-readable domain-specific language and translating them
このページを最初にブックマークしてみませんか?
『Jeff Kreeftmeijer』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く