Skip to content

Instantly share code, notes, and snippets.

@searls
searls / ensures_logger_broadcasts_to_stdout.rb
Last active March 4, 2024 19:18
This logger wrapper I wrote.
# Leverages the BroadcastLogger introduced in Rails 7.1 to wrap the current
# logger in a new logger that broadcasts to both the current logger and $stdout
#
# (Announcement: https://rubyonrails.org/2023/9/29/this-week-in-rails)
#
# If the current logger already broadcasts to $stdout, it will not be wrapped,
# making it safe to call this method multiple times without knowing the current
# logging "sitch".
#
# Usage probably looks something like this:
@0xdevalias
0xdevalias / macos-assign-to-desktop-from-terminal.md
Last active December 19, 2023 16:13
The following shows how you can tell macOS to assign an application to always show on all desktops, one specific desktop, or to unbind it.

macOS - Setting 'Assign to Desktop' via Terminal

The following shows how you can tell macOS to assign an application to show on one specific desktop, all desktops, or just a single desktop.

Show Current Config

⇒ defaults read com.apple.spaces app-bindings
@0xdevalias
0xdevalias / _deobfuscating-unminifying-obfuscated-web-app-code.md
Last active May 3, 2024 12:11
Some notes and tools for reverse engineering / deobfuscating / unminifying obfuscated web app code
@quad
quad / 0-modular-errors-with-rusts-thiserror.md
Last active April 26, 2024 15:57
Modular Errors with Rust's thiserror

I've been writing Rust full-time with a small team for over a year now. Throughout, I've lamented the lack of clear best practices around defining error types. One day, I'd love to write up my journey and enumerate the various strategies I've both seen and tried. Today is not that day.

Today, I want to reply to a blog post that almost perfectly summarised my current practice.

Go read it; I'll wait!


@searls
searls / .solargraph.yml
Last active August 2, 2023 09:14 — forked from DRBragg/.solargraph.yml
My config with steps to use solargraph for Rails projects in VS Code (WIP)
---
include:
- ".solargraph_definitions.rb"
- "app/**/*.rb"
- "config/**/*.rb"
- "lib/**/*.rb"
exclude:
- test/**/*
- vendor/**/*
- ".bundle/**/*"
@jcallaghan
jcallaghan / Automation.yaml
Last active May 17, 2022 20:05
Example #HomeAssistant automation for tracking my medicine to remind me to order more when low.
alias: 'Family - James - Track Medicine'
id: '4df574c4-bb48-4108-b679-76a47966af92'
description: 'Track medicine and order more when low.'
initial_state: true
mode: 'single'
max_exceeded: silent
trigger:
# Let's keep this simple and assume the medicine was taken each day.
@zsviczian
zsviczian / meeting-note.md
Last active March 16, 2024 18:57
Daily note taking scripts

<%* /*

*/
const view = app.workspace.activeLeaf.view;
const editor = view.editor;
const curLineNum = editor.getCursor().line;
const curLineText = editor.getLine(curLineNum);
const title = tp.file.title;
const today = title.match(/\d{4}\-\d{2}\-\d{2} .+/) //are we on the DNP?
# Rails production setup via SQLite3 made durable by https://litestream.io/
# Copy this to Dockerfile on a fresh rails app. Deploy to fly.io or any other container engine.
#
# try locally: docker build . -t rails && docker run -p3000:3000 -it rails
#
# in production you might want to map /data to somewhere on the host,
# but you don't have to!
#
FROM ruby:3.0.2
@yahonda
yahonda / ruby31onrails.md
Last active April 9, 2024 20:46
Ruby 3.1 on Rails

Ruby 3.1 on Rails

Actions required to use Ruby 3.1.0 with Rails

Rails 7.0.Z

  • Rails 7.0.1 is compatible with Ruby 3.1.0.
  • Rails 7.0.1 addes net-smtp, net-imap and net-pop gems as Action Mailbox and Action Mailer dependency, you do not need to add them explicitly in your application Gemfile anymore.
  • thor 1.2.1 has been released. You will not see DidYouMean::SPELL_CHECKERS.merge deprecate warnings anymore.

Rails 6.1.Z

  • Use Rails 6.1.5 to support database.yml with aliases and secrets.yml with aliases.
@shirakaba
shirakaba / README.md
Last active November 17, 2023 00:52
GUI-based debugging of iOS/macOS Rust projects in Xcode

Here's how to get your environment set up to:

  1. Develop iOS and Android apps using Rust.
  2. Enable GUI debugging of Rust projects in Xcode.

If you just want to enable GUI debugging of macOS Rust projects in Xcode, I'm not actually sure whether you need cargo-mobile at all. But one benefit of installing it is that it automatically installs rust-xcode-plugin for you, giving you syntax highlighting of Rust sources in Xcode.

Prerequisites

cargo-mobile