サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
災害への備え
www.schneems.com
Subscribe to my Newsletter 😻 🤠 Join thousands of developers who get new code, writing, and programming links from me delivered to their inboxes. Keep Reading 🚀 Docker without Dockerfile: Build a Ruby on Rails application image in 5 minutes with Cloud Native Buildpacks (CNB) I love the power of containers, but I’ve never loved Dockerfile. In this post we’ll build a working OCI image of a Ruby on
When I used my first ORM, I wondered “why didn’t they include a random() method?” It seemed like such an easy thing to add. While there are many reasons you may want to pull a record out of your database at random, you shouldn’t be using SQL’s ORDER BY RANDOM() unless you’ll only be randomizing a limited number of records. In this post, we’ll examine how such a simple looking SQL operator can caus
These days web assets such as JS and CSS aren’t simple text files. Instead, they’re typically minified or come from a complex build process involving compiling or transpiling. For example, CSS can be generated from a SASS file. JS can be compiled from ES6 using Babel. These toolchains make working with assets easier for developers, and make following best practices such as minification much easier
❶ Author of How to Open Source (.dev). A book to take you from coder to contributor. ❷ Creator of CodeTriage, a free service helping developers contribute to open source. ❸ Core committer to ruby/ruby. ❹ Married to Ruby, literally. Database load can be a silent performance killer. I’ve been optimizing the query performance of a web app I run designed to get people involved in open source, but was
I’ve been writing Ruby code for the past 10+ years, and recently due to my masters courses, I’ve been writing a lot of Python. While there are many differences, one area of similarity is their performance characteristics and how code can be optimized. In this post I’m going to look at a bit of Python code I optimized recently, and then compare the process of making this code faster to the process
This is less a blog post and more of an FYI. This is pretty much verbatim of a snippit I wrote to respond to people asking about the Rubygems vulnerabilities. The TLDR; push to Heroku using any supported Ruby version and you’re safe. If you’re not using a supported Ruby version upgrade your app. The vulnerabilites were fairly low impact, but you should still take steps to protect yourself. Recentl
How on earth does someone accidentally delete 85% of their users’ GitHub tokens? I was suspicious that something might be wrong when I got an email from a service I run called CodeTriage, it’s a free web app to help find open source projects and issues to work on. While I get plenty of emails from my service, I don’t often get ones with the subject line “Code Triage auth failure”. Before we can un
Update: I did mention that lock free data structures are really hard to write, it looks like there might be some issues that haven’t been addressed in the implementation of this LF Queue that we’re referencing. The rest of the analysis is still valid and hopefully useful to you, just know there’s actually more that needs to be done, don’t try to use that code for a mission critical application out
Update: There’s a great resource for dealing with timeouts in Ruby called The ultimate guide to Ruby Timeouts, via @codefolio. Also there’s some good dicussion on Reddit around the possibility of maybe using Thread.handle_interupt in gems, read the comments. Also I added a feature to “SIGTERM” on timeout in rack-timeout that can help mitigate (but not fix) the issue term on timeout documentation.
How does an asset get compiled? It’s less of a pipeline and more of a recursive ball of, well assets. To understand the process we will, start off with an asset with no directives (no require at the top). We’ll then walk through all the steps Sprockets goes through until a usable asset is loaded into memory. For this example we will use a js.erb file to see how a “complex” file (i.e. multiple exte
My favorite part of seeing someone live code is all the mistakes they make, but not because I’m a mean awful person who likes to see others fail. Watching others recover from mistakes helps me recover from my mistakes. It also makes me feel better when I see they mess up the same ways that I do. Too often, programmers beat themselves up when they can’t remember an API and have to Google it, or the
===================== /Users/richardschneeman/documents/projects/my_rails_app/app/controllers/projects_controller.rb:18:in `new' /Users/richardschneeman/.gem/ruby/2.3.0/gems/actionpack-5.0.0.beta1/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action' /Users/richardschneeman/.gem/ruby/2.3.0/gems/actionpack-5.0.0.beta1/lib/abstract_controller/base.rb:183:in `process_action' /Users/
Update: I made a PR to mitigate most of the performance penalty in Omniauth. Deprecating and removing Hashie has resisted several attempts at refactoring. There’s also a really good set of discussions in the Reddit comments. New Ruby programmers mistakenly believe that hashes should be used everywhere for everything. They grow attached to hashes and use them in many places they shouldn’t; creating
America is in the middle of an obesity epidemic, and your Ruby app might be suffering from bloat. While people suffer from overeating, and lack of exercise apps get bigger for other reasons. One of the largest memory sinks in a Ruby app can come not from your code, but from libraries you require. Most developers have no idea what kind of a penalty they incur by adding in a library, and for good re
このページを最初にブックマークしてみませんか?
『Schneems - Programming Practices, Performance, and Pedantry』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く