This file contains 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
/* | |
Docs: https://hexdocs.pm/phoenix_live_view/js-interop.html#client-hooks | |
Usage: when using phx-hook, a unique DOM ID must always be set. | |
<div phx-hook="ExampleHook" id="someUniqueId"></div> | |
*/ | |
// import 'vidstack/styles/defaults.css' | |
// import 'vidstack/styles/community-skin/video.css' |
This file contains 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
@required_fields [ | |
:name, | |
:org_id, | |
:owner_id, | |
:channel_category_id, | |
:slug, | |
:item_ids | |
] | |
@optional_fields [:visibility, :ordinality, :slug, :poster_path, :description, :content_type] |
This file contains 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 UIKit | |
import AVKit | |
import AVFoundation | |
import AssetsLibrary | |
func synchronized(_ object: AnyObject, block: () -> Void) { | |
objc_sync_enter(object) | |
block() | |
objc_sync_exit(object) | |
} |
This file contains 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
def update_changeset(membership, attrs) do | |
dbg(membership) | |
dbg(attrs) | |
# attrs #=> %{is_paid: false, membership_type: "personal", role: "admin"} | |
to_atom_attrs = | |
Enum.map(attrs, fn {k, v} -> | |
if is_atom(v) do | |
{k, v} | |
else |
This file contains 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
// | |
// RecordAudio.swift | |
// | |
// This is a Swift class (updated for Swift 5) | |
// that uses the iOS RemoteIO Audio Unit | |
// to record audio input samples, | |
// (should be instantiated as a singleton object.) | |
// | |
// Created by Ronald Nicholson on 10/21/16. | |
// Copyright © 2017,2019 HotPaw Productions. All rights reserved. |
This file contains 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 Wrangler.Application do | |
# See https://hexdocs.pm/elixir/Application.html | |
# for more information on OTP Applications | |
@moduledoc false | |
use Application | |
@registry Registry.MongoConnectionRegistry | |
@impl true |
This file contains 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
%{ | |
"__v" => 0, | |
"_id" => #BSON.ObjectId<63937fbee42d79b14046ad0f>, | |
"access_restriction_data" => 32, | |
"ambr" => %{ | |
"downlink" => %{"unit" => 3, "value" => 1}, | |
"uplink" => %{"unit" => 3, "value" => 1} | |
}, | |
"imsi" => "001010000000004", | |
"network_access_mode" => 0, |
This file contains 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
IO.puts("I'm here! Sleeping for 2 seconds") | |
Process.sleep 2_000 # waiting for the other node | |
nodes = MapSet.new([:app@app1, :app@app2]) | |
other_node = | |
nodes | |
|> MapSet.delete(Node.self()) | |
|> MapSet.to_list() | |
|> List.first() |
This file contains 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
# Find eligible builder and runner images on Docker Hub. We use Ubuntu/Debian instead of | |
# Alpine to avoid DNS resolution issues in production. | |
# | |
# https://hub.docker.com/r/hexpm/elixir/tags?page=1&name=ubuntu | |
# https://hub.docker.com/_/ubuntu?tab=tags | |
# | |
# | |
# This file is based on these images: | |
# | |
# - https://hub.docker.com/r/hexpm/elixir/tags - for the build image |
This file contains 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 ChessPhxWeb.MatchMainLive do | |
@moduledoc """ | |
List all orgs for the current_user. | |
""" | |
use ChessPhxWeb, :live_view | |
@impl true | |
def mount(_params, _session, socket) do | |
case Chex.new_game() do |