Using CloudFlare Turnstile to protect certain pages on a Rails app
Bibliographic Wilderness
by jrochkind
1M ago
I work at a non-profit academic institution, on a site that manages, searches, and displays digitized historical materials: The Science History Institute Digital Collections. Much of our stuff is public domain, and regardless we put this stuff on the web to be seen and used and shared. (Within the limits of copyright law and fair ..read more
Visit website
Accessing capybara-screenshot artifacts on Github CI
Bibliographic Wilderness
by jrochkind
3M ago
We test our Rails app with rspec and capybara. For local testing, we use the capybara-screenshot plugin which “Automatically save screen shots when a Capybara scenario fails”, even when the tests were running in a headless browser you couldn’t see at all. This can be very helpful in debugging tricky capybara failures, especially ones that ..read more
Visit website
Getting rspec/capybara browser console output for failed tests
Bibliographic Wilderness
by jrochkind
5M ago
I am writing some code that does some smoke tests with capybara in a browser of some Javascript code. Frustratingly, it was failing when run in CI on Github Actions, in ways that I could not reproduce locally. (Of course it ended up being a configuration problem on CI, which you’d expect in this case ..read more
Visit website
Keyword-like arguments to JS functions using destructuring
Bibliographic Wilderness
by jrochkind
5M ago
I am, unusually for me, spending some time writing some non-trivial Javascript, using ES modules. In my usual environment of ruby, I have gotten used to really preferring keyword arguments to functions for clarity. More than one positional argument makes me feel bad. I vaguely remembered there is new-fangled way to exploit modern JS features ..read more
Visit website
Sort order of results in OCLC AssignFAST/fastsuggest API
Bibliographic Wilderness
by jrochkind
7M ago
We have long used the free OCLC AssignFAST API to power an auto-suggest/auto-complete in some of our staff metadata entry forms. (Note: While OCLC calls this service “AssignFAST” in docs, the base URL instead includes the term fastsuggest as in http://fast.oclc.org/searchfast/fastsuggest?, which may be confusing for some!) Recently our staff reported they thought the sort ..read more
Visit website
Cloudfront in front of S3 using response-content-disposition
Bibliographic Wilderness
by jrochkind
9M ago
At the Science History Institute Digital Collections, we have a public collection of digitized historical materials (mostly photographic images of pages). We store these digitized assets — originals as well as various resizes and thumbnails used on our web pages — in AWS S3. Currently, we provide access to these assets directly from S3. For some of our deliveries, we also use the S3 feature of a response-content-disposition query parameter in a signed expiring S3 url, to have the response include an HTTP Content-Disposition header with a filename and often attachment disposition, so when the e ..read more
Visit website
Run your Rails gem CI on rails main branch
Bibliographic Wilderness
by jrochkind
10M ago
attr_json is basically an ActiveRecord extension. It works with multiple versions of Rails, so definitely runs CI on each version it supports. But a while ago on attr_json, i set up CI to run on Rails main unreleased branch. I already was using appraisal to test under multiple Rails versions. (which I recommend; sure it seems easy enough to do this ‘manually’ with conditionals in your Gemspec or separate Gemfiles and BUNDLE_GEMFILE — but as soon as you start needing things like different extra dependencies (version of rspec-rails anyone?) for different Rails versions… stop reinventing the whee ..read more
Visit website
Consider a small donation to rubyland.news?
Bibliographic Wilderness
by jrochkind
1y ago
I started rubyland.news a few years ago because it was a thing I wanted to see for the Ruby community. I had been feeling a shrinking of the ruby open source collaborative community, it felt like the room was emptying out. If you find value in Rubyland News, just a few dollars contribution on my Github Sponsors page would be so appreciated. I wanted to make people writing about ruby and what they were doing with it visible to each other and to the community, in order to try to (re)build/preserve/strengthen a self-conception as a community, connect people to each other, provide entry to newcome ..read more
Visit website
Beware sinatra, rails 7.1, rack 3, resque bundler dependency resolution
Bibliographic Wilderness
by jrochkind
1y ago
tldr practical advice for google: If you use resque 3.6.0 or less, and Rails 7.1, and are getting an error: cannot load such file -- rack/showexceptions — you probably need to add rack "~> 2.0" to your Gemfile! The latest version of the ruby gem sinatra, as I write this, is 3.1.0, and it does not yet support the recently released rack 3. It correctly specifies that in it’s gemspec, with gem "rack", "~> 2.2", ">= 2.2.4” [And as of this writing, that is true in sinatra github main branch too, no work has been done to allow rack 3.x] The new Rails 7.1 does work with and allow Rack 3.x ..read more
Visit website
S3 CORS headers proxied by CloudFront require HEAD not just GET?
Bibliographic Wilderness
by jrochkind
1y ago
I’m not totally sure what happened, but the tldr is that at the end of last week, our video.js-played HLS videos served from an S3 bucket — via CloudFront — appears to have started requiring us to list “HEAD” in the “AllowedMethods” for CORS configuraton, in addition to pre-existing “GET”. I’m curious if anyone else has any insight into what’s going on there… I have some vague guesses at the end, but still don’t really have a handle on it. Our setup: HLS video from S3 buckets We use the open-source video.js to display some video, in the HLS format. Which involves linking to a .m3u8 manifest fi ..read more
Visit website

Follow Bibliographic Wilderness on FeedSpot

Continue with Google
Continue with Apple
OR