Skip to content

Instantly share code, notes, and snippets.

View iftheshoefritz's full-sized avatar

Fritz Meissner iftheshoefritz

  • Cape Town, South Africa
View GitHub Profile
# frozen_string_literal: true
class ProductsController < ApplicationController
include ProductWithQuoteFormParams
before_action :redirect_admins
before_action :set_organization
before_action :set_product,
only: %i[edit update destroy make_public make_private] # TODO why the last two actions?
import ActionCableController from 'controllers/action_cable_controller';
console.log("loading delivery orchestration controller.js");
const statusToListTargetMap = {
pending: 'pendingList',
customer_arrived: 'pendingList',
collecting: 'collectingList',
out_for_delivery: 'finishedList',
delivered: 'finishedList',

Troubleshooting local instance of kafka

Command line kafka utilities

If your rails server or consumer cannot connect to Kafka locally you can try using the command line utilities included with kafka to diagnose whether your kafka is set up properly:

Create a topic:

⚡  kafka-topics --create --partitions 1 --replication-factor 1 --topic new-test-topic --bootstrap-server 127.0.0.1:9092

Created topic new-test-topic.

Railsconf 2022 CFP: LSP and Solargraph

Title

Autocomplete is for Ruby too!

Abstract

A concise, engaging description for the public program. Limited to 600 characters.

Do you have editor-envy when you witness other programmers using fancy IDE features like go-to-definition or auto-complete? Perhaps you've only witnessed this with other languages - maybe those with static typing - but that's not how it has to be.

Powerful - albeit sometimes obscure - open source tools with all these features are available for Ruby. Come hear more! I'll explain the building blocks of code intellisense features; something called Language Server Protocol; a Ruby language server called Solargraph; the solargraph-rails gem; and how you can get involved to make them even better.

@iftheshoefritz
iftheshoefritz / smores.rb
Created August 11, 2023 10:37
Starting point for parallel Ruby conversations
# frozen_string_literal: true
# problem code from Graceful.dev: https://graceful.dev/courses/tapastry/modules/2019/topic/full-utilization/
$tick = 0
def work(seconds)
$tick += seconds
end
def log(message)