tldr: RediSearch - a full text search redis module that is super fast. I learnt of RediSearch 2 years ago. It was a young project back then but seems very promising at time. When I revisit it last year, it’s quite mature already and was about to hit v1.0 so I did another test drive. The result was so good I put it on production few weeks later. Its pros are:
TLDR: ✨ 2018 in review ✨ 👩🏻💼 My wife got promoted 👨💻 Another amazing year at work for me 🏠 We bought a house 🤑 We paid off the loan early 🎤 Gave 2 public talks (or 1. The first one is a rather small audience - 50-ish people) We bought a house # My wife and I went for a major decision earlier this year. We decided to buy a house with a little loan.
Over the years, I customized my keyboard layout a lot (Bootmapper client then and QMK Toolbox now) and this is what I ended up using. It’s pretty much HHKB layout with some QMK hacks on top. Change CAPLOCK to CTRL # CAPLOCK is useless to me so I change it to CTRL. I also set it up to use Mod-Tap key which will act as CTRL if I hold it but works as BACKSPACE if I tap it.
macOS media keys # macOS media keys are supported on QMK: KC__MUTE, KC__VOLUP, KC__VOLDOWN, etc… This is essential if you’re using macOS. Grave Escape # If you’re using a 60% keyboard, or any other layout with no F-row, you will have noticed that there is no dedicated Escape key. Grave Escape is a feature that allows you to share the grave key (` and ~) with Escape.
camaro is an utility to transform XML to JSON using a template engine powered by XPath syntax which looks like this Here are some benchmarks I ran with the sample data I usually have to deal with (XML data ranges from 1-10MB) camaro x 809 ops/sec ±1.51% (86 runs sampled) rapidx2j x 204 ops/sec ±1.22% (81 runs sampled) xml2json x 53.73 ops/sec ±0.58% (68 runs sampled) xml2js x 40.57 ops/sec ±7.
So I was going through this post from Instagram Engineering blog while researching for some sharding solutions. The solution is quite elegant and I decided to port this to MySQL. Turns out, it’s harder than I thought since we’re using a pretty dated MySQL version at work. There is no sequence, just AUTO_INCREMENTAL. In order to use the code snippet for PL/PGSQL, I would have to find a way to mimic nextval function.
Set and sorted set are extremely powerful data types for filtering and sorting stuff with redis. Basic filtering # Let’s start with something simple. Usually filtering is just a matter of union and intersection. Let’s say: filter all hotels that are 3 or 4 star and have both spa and pool. For this, we just have to create a set for each of the filter criteria and do union/intersection accordingly.
Some personal notes while working with GraphQL Only enable GraphiQL in development. GraphQL is quite “chatty” by default. Use something like Facebook’s DataLoader for batching requests. DataLoader is not responsible for pagination. Implementation will be varied based on different backends. Apollo GraphQL is pretty awesome. Check out some of their open-source libraries. Using cacheKeyFn for batching function (DataLoader) with multiple parameters. Related issue: #75 GraphQL is much more prone to attack because of its flexibility.