Mix.install(
[
{:kino, "~> 0.7.0"},
{:vega_lite, "~> 0.1.6"},
{:kino_vega_lite, "~> 0.1.7"}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Environment variables: | |
| * TRAVIS_API_TOKEN | |
| * TRAVIS_REPO_SLUG (%2F separated, e.g. ftes%2Fsongbook-latex) | |
| */ | |
| const https = require('https') | |
| const url = `https://api.travis-ci.com/repo/${process.env.TRAVIS_REPO_SLUG}/requests` | |
| const options = { | |
| method: 'POST', | |
| headers: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Environment variables are escaped by the envsubst entrypoint | |
| homeassistant: false | |
| permit_join: $ZIGBEE2MQTT_PERMIT_JOIN | |
| mqtt: | |
| base_topic: zigbee2mqtt | |
| server: 'mqtt://mqtt' | |
| serial: | |
| port: $ZIGBEE2MQTT_SERIAL_PORT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule PetalsDragNDropWeb.PageLive do | |
| use PetalsDragNDropWeb, :live_view | |
| data world, :string, default: "world!" | |
| @impl true | |
| def render(assigns) do | |
| ~F""" | |
| <div | |
| id="page" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div | |
| x-data="{dragging: false}" | |
| :hook="GridWithDragAndDrop" | |
| > | |
| {#for %{x: x, y: y} = item <- @data} | |
| <div | |
| id={item[:id]} | |
| draggable="true" | |
| ... | |
| > |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule PetalsDragNDropWeb.PageLive do | |
| # ... | |
| @impl true | |
| def render(assigns) do | |
| ~F""" | |
| ... | |
| <GridWithDragAndDrop | |
| dragged="letter_dragged" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if @dragged.target == :live_view do | |
| "hook.pushEvent('#{@dragged.name}', {from, to});" | |
| else | |
| "hook.pushEventTo('#{@dragged.target}', '#{@dragged.name}', {from, to});" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Mixins.Projection do | |
| defmacro __using__(params) do | |
| table = Keyword.get(params, :table) || raise "Missing param :table" | |
| Module.register_attribute(__CALLER__.module, :table, persist: true) | |
| Module.put_attribute(__CALLER__.module, :table, table) | |
| quote do | |
| use Ecto.Schema | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const PushEventHook = { | |
| mounted() { | |
| const target = this.el.attributes["phx-target"]?.value | |
| this.el.__pushEvent = (event, value, onReply = () => {}) => | |
| target | |
| ? this.pushEventTo(target, event, value, onReply) | |
| : this.pushEvent(event, value, onReply) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default class ComboboxFormWebcomponent extends HTMLElement { | |
| connectedCallback() { | |
| // ... | |
| const inputId = this.getAttribute("input-id") | |
| this.inputEl = document.getElementById(inputId) | |
| this.inputEl.addEventListener("change", this.onValueChange) | |
| this.render() | |
| } | |
| disconnectedCallback() { |