ARG RUBY_VERSION=3.3.6
FROM ruby:$RUBY_VERSION
ENV RAILS_ENV=production \
BUNDLE_PATH=/bundle \
BUNDLE_WITHOUT="development test" \
| <%# Create a partial for generating a trigger element to be appended to the container in a turbo_stream %> | |
| <% selectors ||= '' %> | |
| <% | |
| # As a convenience, we can use Array.wrap to turn the selector value into an array if it is not one, then use join(' ') to | |
| # create a list that works nicely with the stimulus controller. | |
| %> | |
| <div data-refresh-target='trigger' data-selctors='<%= Array.wrap(selectors).join(" ") %>' |
While it's possible to stream most content to Apple Vision Pro directly over the internet, having the ability to use Apple Vision Pro as an HDMI display can still be useful.
Since Apple Vision Pro does not support connecting to an HDMI input directly or using an HDMI capture card, we have to be a little creative to make this work. NDI provides the ability to stream HDMI content over a local network with really low latency, and it works great with Apple Vision Pro.
This page shows the setup I’m using.
| Rails.application.configure do | |
| # Add Cloudflare's IPs to the trusted proxy list so they are ignored when | |
| # determining the true client IP. | |
| # | |
| # See https://www.cloudflare.com/ips-v4/ and https://www.cloudflare.com/ips-v6/ | |
| config.action_dispatch.trusted_proxies = ActionDispatch::RemoteIp::TRUSTED_PROXIES + %w[ | |
| 173.245.48.0/20 | |
| 103.21.244.0/22 | |
| 103.22.200.0/22 | |
| 103.31.4.0/22 |
| def active_link_to(name = nil, options = nil, **html_options, &block) | |
| options = block_given? ? name : options | |
| if current_page?(options) | |
| html_options[:class] = class_names(html_options[:class], :active) | |
| html_options[:aria] = html_options.fetch(:aria, {}).merge(current: :page) | |
| end | |
| if block_given? | |
| link_to options, html_options, &block |
| trap("SIGINT") { exit! } | |
| total_width = `stty size`.scan(/\d+/)[1].to_i # terminal width | |
| snowflakes = {} | |
| puts "\033[2J"; # clearing output | |
| loop do | |
| snowflakes[rand(total_width)] = 0 |
| import base64 | |
| import hashlib | |
| import hmac | |
| import locale | |
| import plistlib as plist | |
| from datetime import datetime | |
| import logging | |
| import requests | |
| import srp._pysrp as srp | |
| import urllib3 |
| --- | |
| include: | |
| - ".solargraph_definitions.rb" | |
| - "app/**/*.rb" | |
| - "config/**/*.rb" | |
| - "lib/**/*.rb" | |
| exclude: | |
| - test/**/* | |
| - vendor/**/* | |
| - ".bundle/**/*" |
Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.
Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.
The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.
| // DISCLAIMER : You can now probably use `data-turbo-action="advance"` on your frame to perform what this controller is aiming to do | |
| // https://turbo.hotwired.dev/handbook/frames#promoting-a-frame-navigation-to-a-page-visit | |
| // Note that you probably want to disable turbo cache as well for those page to make popstate work properly | |
| import { navigator } from '@hotwired/turbo' | |
| import { Controller } from '@hotwired/stimulus' | |
| import { useMutation } from 'stimulus-use' | |
| export default class extends Controller { | |
| connect (): void { |
