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
import http from "k6/http"; | |
import ws from "k6/ws"; | |
export const options = { | |
// Key configurations for spike in this section | |
stages: [ | |
{ duration: "2m", target: 100 }, // fast ramp-up to a high point | |
// No plateau | |
{ duration: "1m", target: 0 }, // quick ramp-down to 0 users | |
], |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta | |
name="viewport" | |
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" | |
/> | |
<title>Let it Crash with Elixir</title> |
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 MyApp.CSV do | |
@moduledoc false | |
NimbleCSV.define(MyyApp.CSV.RFC4180, | |
# defaults from NimbleCSV.Spreadsheet | |
separator: ",", | |
escape: "\"", | |
line_separator: "\r\n", | |
escape_formula: %{["@", "+", "-", "=", "\t", "\r"] => "'"} | |
) |
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
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"}, |
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() { |
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
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
if @dragged.target == :live_view do | |
"hook.pushEvent('#{@dragged.name}', {from, to});" | |
else | |
"hook.pushEventTo('#{@dragged.target}', '#{@dragged.name}', {from, to});" | |
end |
NewerOlder