サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
Wikipedia
blog.honeybadger.io
If you want Ruby's string methods to play nicely with Unicode, it's a good idea to normalize them. This article is a brief introduction to Unicode normalization for Rubyists. I recently published an article in which I tested most of Ruby's string methods with certain Unicode characters to see if they would behave unexpectedly. Many of them did. One criticism that a few people had of the article wa
To see how far Ruby's Unicode support has come, I tested every string method to see which ones violate the principle of least surprise. The results are presented as a handy table that you can reference to see which string manipulation methods are Unicode-unfriendly. Among the new features shipped with Ruby 2.4 is improved Unicode support. Specifically, methods like upcase and downcase work as expe
In this post we'll discuss a few easy wins - things you can do when a Rails project is young to make it much easier to scale its data layer as the project grows. When you're working on a young project you're constantly making decisions that will make it either easier or harder to scale later. Sometimes it's good to pick the short-term gain, to accrue a bit of technical debt so you can ship faster.
Here's an easy way to run multiple Sidekiq processes via systemd. At Honeybadger we depend heavily on Sidekiq in our processing pipeline. Nearly everything we do runs through a queue at some point. As a result, I want to make sure we are running Sidekiq well. With our recent move to EC2, we changed from having a stable set of long-lived servers to an ever-changing set of instances running our jobs
Many of the most common ActiveRecord idioms produce SQL which doesn't scale well as your dataset gets larger. In this article I discuss three of the worst offenders and offer work-arounds. I remember the first time I saw rails' ActiveRecord. It was a revelation. This was back in 2005 and I was hand-coding SQL queries for a PHP app. Suddenly, using the database went from being a tedious chore, to b
Byebug is a simple to use, feature rich debugger for Ruby 2.x. In this post, we'll discuss how to set up remote debugging with byebug so that you can debug code running in Pow, Unicorn or other application servers. If you haven't seen byebug before, I recommend that you check it out. It's a great debugger for Ruby 2.x. In the words of its authors: Byebug is a simple to use, feature rich debugger f
To really master the command line you have to master dozens - if not hundreds - of small utility programs. Fortunately, it's possible to replace a lot of these single-purpose tools with a general-purpose programming language like Ruby. This post will show you how you can use your Ruby skills to level up your command-line game. To really master the command line you have to master dozens — if not hu
Did you know that it's possible to log all method calls as they occur in a running process in real time? How about injecting code to be executed inside of a running process? You can – via the magic of the rbtrace gem. Did you know that it's possible to log all method calls as they occur in a running process in real time? How about injecting code to be executed inside of a running process? You can
These days it's pretty common to see #freeze used in Ruby code. But it's often not entirely clear WHY freeze is being used. In this post we'll look at the most common reasons a developer might freeze variables. These days it's pretty common to see #freeze used in Ruby code. But it's often not entirely clear WHY freeze is being used. In this post we'll look at the most common reasons a developer mi
If you want your app to behave well in a unix environment, it's important that it exit correctly. In this post you'll learn all about unix exit codes, the mechanism that Ruby uses to exit a program, and how you can add custom behavior on exit. As developers, we spend so much time on making our programs run that it's easy to overlook how they exit. And it's important! When your programs behave corr
Files are just large collections of lines or characters. Lazy enumerators make it possible to to some very interesting and powerful things with them. Enumerators are at the heart of what makes Ruby such a powerful, dynamic language. And lazy enumerators take this a step further by allowing you to efficiently work with extremely large collections. Files - it turns out - are just large collections o
In this post we start out with the basics of unix sockets and finish by creating our own simple Ruby application server which can be proxied by nginx. Ruby application servers are typically used together with a web server like nginx. When user requests a page from your Rails app, nginx delegates the request to the application server. But how exactly does that work? How does nginx talk with unicorn
Nothing could be simpler and more boring than the case statement. It’s a holdover from C. You use it to replace a bunch of ifs. Case closed. Or is it? Actually, case statements in Ruby are a lot richer and more complex than you might imagine. Let’s take a look. Nothing could be simpler and more boring than the case statement. It's a holdover from C. You use it to replace a bunch of ifs. Case close
The humble ruby Hash has a few tricks up its sleeve. Far from being a dumb key-value system, the Hash object gives you the power to do some very interesting and sophisticated things. When you use something as much as Ruby developers use Hashes, it's easy to think you've seen it all. But I'm here to tell you that the humble ruby Hash has a few tricks up its sleeve. Far from being a dumb key-value s
Did you know you can use lambdas as a kind of dynamic hash replacement? The truth is, lambdas are pretty cool once you start to investigate them. In this post we'll cover basic usage and then show you some cool lambda tricks. Blocks are such an important part of Ruby, it's hard to imagine the language without them. But lambdas? Who loves lambdas? You could go years without using one. They almost s
If you want to be able to effectively manage web apps in development and in production, you have to understand environment variables. This post will show you how environment variables really work - and perhaps more importantly, how they DON'T work. We'll also explore some of the most common ways to manage environment variables in your Rails apps. If you want to be able to effectively manage web ap
このページを最初にブックマークしてみませんか?
『blog.honeybadger.io』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く