Skip to content

Instantly share code, notes, and snippets.

View mkumm's full-sized avatar

Michael Kumm mkumm

View GitHub Profile
@mkumm
mkumm / consumer.js
Created May 10, 2024 11:41
A simple RabbitMQ consumer in JavaScript
#!/usr/bin/env node
var amqp = require('amqplib/callback_api');
amqp.connect('amqp://localhost:5675', function(_, connection) {
connection.createChannel(function(_, channel) {
var queue = 'sneakers';
channel.assertQueue(queue, {
durable: false
@mkumm
mkumm / producer.livemd
Created May 10, 2024 11:38
Sample RabbitMQ Producer in Elixir Livebook

Producer

Mix.install([
  {:amqp, "~> 3.3"}
])

Section

// Zed settings
// .config/zed/settings.json
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run the `open default settings` command
// from the command palette or from `Zed` application menu.
{
@mkumm
mkumm / sample_benchee.livemd
Created February 17, 2024 15:01
Livebook - Sample Benchee

Sample Benchee

Mix.install([
  {:benchee, "~> 1.3"}
])

Section

@mkumm
mkumm / config-AlpineJS-3-phx-live.js
Created July 9, 2021 13:11
AlpineJS 3 with Phoenix Live
import "../css/app.scss"
import "phoenix_html"
import {Socket} from "phoenix"
import topbar from "topbar"
import {LiveSocket} from "phoenix_live_view"
import Alpine from 'alpinejs'
window.Alpine = Alpine
Alpine.start()
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
@mkumm
mkumm / ch2.rkt
Created March 8, 2021 18:54
Scheme for Chapter 2 - The Little Schemer
#lang Scheme
(define atom?
(λ (x)
(and (not (pair? x)) (not (null? x)))))
(define lat?
(λ (l)
(cond
((null? l) #t)
((atom? (car l)) (lat? (cdr l)))
[
{
"id": 1,
"name": "Adeline Table Lamp",
"sku": "13-1284",
"image_url": "s3://research-at-amber-engine/13-1284.png",
"map": 555.0,
"msrp": 750.0,
"sources": [
{
[{"id":"1","image_url":"https://research-at-amber-engine.s3.amazonaws.com/Image+2019-10-21+at+3.26.07+PM.png","map":"250","msrp":"725","name":"Really early version of a thing","sku":"173434"},{"id":2,"image_url":"https://research-at-amber-engine.s3.amazonaws.com/Image+2019-10-21+at+3.26.07+PM.png","map":270,"msrp":750,"name":"Really early version of a thing 2","sku":"173488"}]
-module(second).
-export([hyp/2, perimeter/2, area/2]).
-import(first, [square/2,mult/2]).
% Just to show I know what a comment is ;)
hyp(A,B) ->
math:sqrt(first:square(A) + first:square(B)).
perimeter(A,B) ->
A + B + hyp(A,B).
google-site-verification: google8b24f2f0ba9c79bd.html