Skip to content

Instantly share code, notes, and snippets.

@aymanosman
aymanosman / bug-view-undefined.exs
Last active April 19, 2024 07:47
bug-view-undefined.exs
Application.put_env(:sample, Example.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 5001],
server: true,
live_view: [signing_salt: "aaaaaaaa"],
secret_key_base: String.duplicate("a", 64)
)
Mix.install([
{:plug_cowboy, "~> 2.5"},
{:jason, "~> 1.0"},
@aymanosman
aymanosman / monorepo.el
Created March 11, 2024 15:29
monorepos in project.el
;; -*- lexical-binding: t; -*-
(defvar monorepo-root-markers '(("package.json"
(ignores . ("node_modules")))
("mix.exs"
(ignores . ("_build/" "deps/")))
"*.asd"))
(defun monorepo-try-find-project (dir)
(let* ((found (monorepo--find-project dir)))
@aymanosman
aymanosman / input-line-eff.lisp
Last active March 28, 2023 16:17
Restarts in Common Lisp
;; https://github.com/ocaml-multicore/ocaml-effects-tutorial/blob/master/sources/input_line_eff.ml
(define-condition conversion-failure (error)
((string :initarg :string))
(:report (lambda (condition stream)
(format stream "Conversion failure ~S" (slot-value condition 'string)))))
(defun int-of-string (string)
(handler-case
(parse-integer string)