Skip to content

Instantly share code, notes, and snippets.

View mrdotb's full-sized avatar
🦊

mrdotb mrdotb

🦊
View GitHub Profile
@mrdotb
mrdotb / core_components.ex
Created June 9, 2024 09:01
Add lucide components to phoenix
def icon(%{name: "hero-" <> _} = assigns) do
~H"""
<span class={[@name, @class]} />
"""
end
# Add the pattern match fn for lucide
def icon(%{name: "lucide-" <> _} = assigns) do
~H"""
<span class={[@name, @class]} />
@mrdotb
mrdotb / report.livemd
Created November 29, 2023 09:38
Flow step transaction error log + doc issue

Flow Step transaction error log + doc issue

Application.put_env(:ash, :validate_api_resource_inclusion?, false)
Application.put_env(:ash, :validate_api_config_inclusion?, false)
Mix.install([:ash, :faker], consolidate_protocols: false)

Stuff

@mrdotb
mrdotb / report.livemd
Created November 28, 2023 13:26
Ash runtime error on action argument array of self type

Ash runtime error on action argument array of self type

Application.put_env(:ash, :validate_api_resource_inclusion?, false)
Application.put_env(:ash, :validate_api_config_inclusion?, false)
Mix.install([:ash], consolidate_protocols: false)

Working arguments array of dummy

@mrdotb
mrdotb / logs.txt
Created May 24, 2023 13:29
vix on windows compilation errors
nmake /f makefile.win
Microsoft (R) Program Maintenance Utility Version 14.32.31329.0
Copyright (C) Microsoft Corporation. All rights reserved.
del /Q /F priv
erl -noshell -s init stop -eval "io:setopts(standard_io, [{encoding, unicode}]), io:format(\"ERTS_INCLUDE_PATH=~ts/erts-~ts/include/\", [code:root_dir(), erlang:system_info(version)])." > Makefile.auto.win
nmake /F Makefile.win priv\vix.dll
Microsoft (R) Program Maintenance Utility Version 14.32.31329.0
@mrdotb
mrdotb / montage.livemd
Created April 21, 2023 19:36
montage.livemd

Montage

Mix.install([
  {:image, "~> 0.28.0"},
  {:tesla, "~> 1.6"},
  {:kino, "~> 0.9.2"}
])
@mrdotb
mrdotb / image-crop-and-perspective-no-priv-deps.livemd
Created April 20, 2023 10:54
image-crop-and-perspective-no-priv-deps.livemd

Image perspective

Mix.install([
  {:tesla, "~> 1.6"},
  {:kino, "~> 0.9.2"},
  {:nx, "~> 0.4"},
  {:evision, "~> 0.1"}
])
@mrdotb
mrdotb / timeago.js
Created April 17, 2023 09:52
timeago.js
/**
* @license MIT
* timeago.js 4.0.2
* https://github.com/mrdotb/timeago.js
* Copyright (c) 2016 Hust.cc
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).timeago={})}(this,function(e){"use strict";function t(e,t){n[e]=t}function r(e){return n[e]||n.en_US}var n={},a=[60,60,24,7,365/7/12,12];function o(e){return e instanceof Date?e:!isNaN(e)||/^\d+$/.test(e)?new Date(parseInt(e)):(e=(e||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(e))}function s(e,t){for(var n=e<0?1:0,r=e=Math.abs(e),o=0;e>=a[o]&&o<a.length;o++)e/=a[o];return(0===(o*=2)?9:1)<(e=Math.floor(e))&&(o+=1),t(e,o,r)[n].replace("%s",e.toString())}function u(e,t){return(+(t?o(t):new Date)-+o(e))/1e3}var c="timeago-id";function f(e){return parseInt(e.getAttribute(c))}var d={},g=function(e){clearTimeout(e),delete d[e]};function l(
@mrdotb
mrdotb / row_component.ex
Created September 22, 2022 12:02
row_component.ex
defmodule ProbuildExWeb.GameLive.RowComponent do
use ProbuildExWeb, :live_component
alias Phoenix.LiveView.JS
alias ProbuildEx.App
import ProbuildExWeb.GameLive.GridElementComponent
import ProbuildExWeb.GameLive.DdragonComponent
@defaults %{
@mrdotb
mrdotb / pro-list.json
Created August 13, 2022 17:54
UGG pro list
[
{
"current_ign": "다난번",
"current_team": "Team Aze",
"league": "LLA",
"main_role": "adc",
"normalized_name": "5kid",
"official_name": "5kid",
"region_id": "kr"
},
@mrdotb
mrdotb / opening_hours.sql
Last active March 29, 2022 15:45
opening_hours
create table opening_hours
(
-- il est possible d'utiliser les horaires d'une boutique en particulier pour l'eshop
point_of_sale_id uuid REFERENCES point_of_sale (uuid), -- donc nullable
-- il est aussi possible pour l'eshop d'avoir ses propres horaires
terminal_eshop_id uuid REFERENCES terminal_eshops (uuid), -- donc nullable
day_of_the_week integer NOT NULL,
open time without time zone not NULL, -- est-ce qu'on a besoin de stocker la time zone ?
close time without time zone not NULL
);