Recently our Ops team has wanted to experiment with client compression on MySQL to help alleviate some internal network congestion. After much trial and error we hit upon a solution for the mysql2 gem in Rails 2.x, 3.x, 4.x and Sequel. I hope this helps others struggling to find a way to do this. Comeback soon to see what effect Client Compression had on our network.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 # config/initializers/enable_connection_flags.rb module
Last month, Shane Emmons did a post on implementing pipe in ruby. Check out his post here.
As Shane mentioned, the unix pipe operator is extremely powerful and simple to use / understand. The result of the first operation is passed as the argument for the next operation and so on. Last summer, shortly before I came onboard, Shane implemented our first version:
1 2 3 4 5 6 def pipe(initial_env, through:) through.reduce(initial_env) do |env, method| status, _, _ = env success?(status
Have you ever broken your development environment and dreaded of the hours it will take to rebuild your environment? I certainly have, on multiple occasions. This is where Vagrant comes to the rescue! Vagrant is an excellent tool to build disposable, lightweight development environments. It leverages the power of Virtual Machines (VM) to allow you to easily build customizable images, so you can quickly bring up a custom environment.
To start, simply downloadContinue Reading
Since the first gem was born, gem authors have had to toe the line between configurability and supportability. This post covers a facet of this conundrum - when and how to extract certain functionality from an app into a gem and how to support low level configurability. For those interested in a higher level discussion of gem configuration patterns, Brandon Hilkert does a good job covering this landscape in his blog post Ruby Gem Configuration Patterns.
So, what does "low level" configurability...Continue Reading
Recently, we've been working on migrating email from our 'Classic' codebase into our 'NextJenn' architecture. If you've ever worked with ActionMailer emails, you know that this is a bigger task than it sounds.
One issue in particular has proven very tricky. Due in part to differing regulations in different geographic locations (I'm looking at you, Canada) and in part to the team level customization possible, there are dozens of different permutations for many of the several dozen emails that...Continue Reading
| (pipe) operator is an extremely powerful and simple tool. With it you can do amazing feats, like kill vagrant when it's misbehaving:
1 ps aux | grep vagrant | grep -v grep | tr -s " " | cut -d" " -f2 | xargs kill
or open every file that references
1 vi $(ag ShimMessageView -l --nocolor | xargs)
Simply stated, the
pipe takes input from the left, runs it through a command and outputs it on the right. Data in, data out. This pattern is so powerful, many languages,...