Converting string characters to or from their integer value (7-bit ASCII value or UTF-8 codepoint) can be done...
As your Rails project grows, you will accumulate a number of small patches. These will usually fix a bug in...
Helix allows you to implement performance-critical code of your Ruby app in Rust, without requiring glue code to bridge...
When dealing with time zones in Rails, there is one key fact to keep in mind: Rails has configurable time...
Instead of using this hack you might want to use MariaDB 10.x which can work with both old and...
Stackprof is a sampling call-stack profile for Ruby 2.1+. Instead of tracking all method calls, it will simply collect...
Uses FFI and works all relevant operating systems. If you'd try to do it yourself, you'd have to...
You login to a Linux server with a performance issue: what do you check in the first minute? uptime
rack-mini-profiler is a powerful Swiss army knife for Rack app performance. Measure SQL queries, memory allocation and CPU...
In Ruby 2.3 you can use <<~ instead of <<- to automatically remove indentation from a HEREDOCs: str = <<~MESSAGE Hello Universe!
The nokogiri gem provides different packages for several platforms. Each platform-specific variant ships pre-built binaries of libxml2, e.g...
E-mails are usually encoded using Quoted Printable. Here is how to decode or encode such strings. You probably know...
This looks like it is safe to use: 2.2.1 :001 > a = b = "hello world" "hello world" 2.2.1 :002 > a
I recommend to go straight to 2.1.5+ without intermediate steps. Otherwhise you burden yourself with unnecessary work of encoding problems...
Ruby has the class Proc which encapsulates a "block of code". There are 2 "flavors" of Procs: Those with "block...
This class contains nerdcore things such as disassembling a piece of Ruby into VM calls or enabling tail-call optimization...
Sometimes you just want to have a small web server that serves files to test something. Serve the current directory...
There are many solutions, but a very concise one is this: hash.merge!(hash) do |key, old_value, new_value|
Sometimes you want to know exactly how many objects exist within your running Ruby process. Here is how: stats = {} ObjectSpace.each...
This is basically Ruby-native syntax for andand.
Ruby has a set of methods to convert an object to another representation. Most of them come in explicit and...
When you make a simple TCP connection to a remote server (like telnet), your client won't normally notice when...
You want to test your 1GE or 10GE internet uplink? We needed to ensure we have full 10GE to the...
Ruby allows multiple assignment: a, b, c = o In order to prove multiple values from a single object, Ruby calls...