Let PostgreSQL Generate Your CSV in Rails
By using the COPY function in postgresql, we can save a lot of time and memory letting postgres generating instead of ActiveRecord and Ruby.
By using the COPY function in postgresql, we can save a lot of time and memory letting postgres generating instead of ActiveRecord and Ruby.
I was recently working on a side project with Greg Molnar and he convinced me to try MiniTest. After 10+ years of using rspec and nothing else, I was reluctant to try. I'd of course poked at it before, but could never get in the swing of things. One of the main issues was that I had been using Vim, Tmux, and Tslime to magically and wonderfully send specs to a different tmux pane. This didn't work with MiniTest, and I couldn't find a replacement.
I made a huge mistake! I hate deleting production data, but was asked to do so by a new customer on TRACT. It didn't go well. Here's the story of how I was able to restore the specific data I deleted.
This is an amazing world we live in. I'm not a "well traveled" person, so bear with me if this is nothing new to you.
We (my wife and youngest son) came to Las Vegas for a Ruby conference called Sin City Ruby that took place Thur & Friday. Saturday was a free day, but we were flying home that night (11:44p) so we had a good bit of time to explore.
When it comes to authorization, the outcome typically either allows or disallows an action (read, update, delete, etc). But what if you need flexibility to define rules about certain actions, parameters and attributes and also inform the user why their change cannot be made?
On a recent interview with Matt Smith, he described leaving the agency he had been at to work independently. The agency had a project for him to work on for 20hrs per week and that left another 20hrs per week to work on other projects.
I love ActiveRecord and it's great for building queries in rails, but sometimes you just need to execute a query and you want the results in an array without all the ActiveRecord objects instantiated. This can be especially useful when gathering a large number of records for reports (which was the use case that drove me to exploring this topic). I was pretty happy to see we could achieve a 6x speed increase and a 4x memory savings.
In a recent podcast, we interview Allan Branch and relive some of the funny and creative marketing ideas they had. (24:24 listen til around 27:30). Jeremy asks a great question about implementing these type of ideas. Ideas that many would characterize as risky, silly, or not worth the effort. Most everyone has "good/cool ideas" but they usually end there.
In our most recent podcast, we interviewed Allan Branch. I've known Allan for a long time since his early days at LessEverything. I went to several of their conferences and also a work shop called LessMoney. Allan always made me feel like a close friend, even though he always had hundreds of people ving for his attention. LessMoney also changed my career. Before attending I was a solo dev working in a silo and afterwards, I had so much more knowledge and friends.
I always learn a lot from Allan and I wanted to share the snips I saved from the interview.
I just recently found this bug in one of our codebases I wanted to share.