See how a minor change to your commit message style can make a difference.
git commit \ -m"<type>(<optional scope>): <description>" \ -m"<optional body>" \ -m"<optional footer>"
# Single-file Phoenix LiveView demo showing how to batch events to reduce/control the flow of UI updates. | |
# | |
# Run with `elixir batcher_demo.exs`, then open a browser at http://localhost:5001/. | |
# | |
# For comparison, the "inc" event is batched while the "dec" event is not. | |
# | |
# References | |
# | |
# https://github.com/phoenixframework/phoenix_live_view/blob/main/.github/single-file-samples/main.exs | |
# https://elixirforum.com/t/optimizing-liveview-for-realtime-applications-by-marlus-saraiva-elixirconf-eu-2023/59265?u=rhcarvalho |
config :wps, WPSWeb.Endpoint, | |
live_reload: [ | |
notify: [ | |
live_view: [ | |
~r"lib/wps_web/core_components.ex$", | |
~r"lib/wps_web/(live|components)/.*(ex|heex)$" | |
] | |
], | |
patterns: [ | |
~r"priv/static/(?!uploads/).*(js|css|png|jpeg|jpg|gif|svg)$", |
Mix.install([:mint, :castore]) | |
defmodule Main do | |
def run() do | |
total = | |
Stream.resource( | |
fn -> | |
{:ok, conn} = Mint.HTTP.connect(:https, "ftp.bit.nl", 443, mode: :passive) | |
{:ok, conn, _ref} = Mint.HTTP.request(conn, "GET", "/speedtest/10mb.bin", [], nil) | |
{conn, true} |
export class DurationUnit { | |
constructor(public readonly value: number, public readonly name: string) {} | |
} | |
export const nanoSecond = new DurationUnit(1, 'ns'); | |
export const microSecond = new DurationUnit(1000 * nanoSecond.value, 'µs'); | |
export const milliSecond = new DurationUnit(1000 * microSecond.value, 'ms'); | |
export const second = new DurationUnit(1000 * milliSecond.value, 's'); | |
export const minute = new DurationUnit(60 * second.value, 'm'); | |
export const hour = new DurationUnit(60 * minute.value, 'h'); |
rem to disable private dns | |
adb shell settings put global private_dns_mode off | |
rem to enable private dns with hostname (example with dns.adguard.com) | |
adb shell settings put global private_dns_mode hostname | |
adb shell settings put global private_dns_specifier dns.adguard.com |
defmodule ApiDataStructure do | |
defmodule User do | |
use Ecto.Schema | |
import Ecto.Changeset | |
alias ApiDataStructure.Profile | |
embedded_schema do | |
field :username, :string |
#!/usr/bin/env python | |
import argparse | |
import calendar | |
import itertools as it | |
from datetime import datetime | |
from csv2ofx import utils | |
from csv2ofx.mappings.default import mapping | |
from csv2ofx.ofx import OFX |
See how a minor change to your commit message style can make a difference.
git commit \ -m"<type>(<optional scope>): <description>" \ -m"<optional body>" \ -m"<optional footer>"
# You will need fswatch installed (available in homebrew and friends) | |
# The command below will run tests and wait until fswatch writes something. | |
# The --stale flag will only run stale entries, it requires Elixir v1.3. | |
fswatch lib/ test/ | mix test --stale --listen-on-stdin |