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
defp handle_validation(socket, {:ok, _user_pin}) do | |
Accounts.UserPin.purge_pins(socket.assigns.auth_user) | |
sign_in_token = | |
socket.assigns.auth_user | |
|> Accounts.generate_user_session_token() | |
|> Base.encode64() | |
# sign_in_token is still valid up to here | |
dbg(sign_in_token) |
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
[watch] build finished, watching for changes... | |
Rebuilding... | |
Done in 911ms. | |
[debug] Upgrading connection to websocket | |
[debug] Shard connection up, waiting for consumers to boot | |
[error] ** State machine <0.715.0> terminating | |
** Last event = {info,{gun_upgrade,<0.735.0>, | |
#Ref<0.3877279376.554958849.24784>, |
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
[error] ** State machine <0.715.0> terminating | |
** Last event = {state_timeout,connect_timeout} | |
** When server state = {connecting_http, | |
#{stream => nil,seq => nil, | |
'__struct__' => 'Elixir.Nostrum.Struct.WSState', | |
session => nil,conn => <0.720.0>, | |
gateway => <<"gateway.discord.gg">>, | |
last_heartbeat_ack => nil, | |
last_heartbeat_send => nil, | |
heartbeat_interval => nil,shard_num => 0, |
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 Word.Repo.Migrations.CreateMusic do | |
use Ecto.Migration | |
def change do | |
execute "CREATE EXTENSION IF NOT EXISTS citext", "" | |
create table(:music, primary_key: false) do | |
add :id, :id, primary_key: true | |
add :absolute_id, :integer | |
add :uuid, :uuid |
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 SwiftUI | |
import LNPopupUI | |
import LNPopupController | |
import Combine | |
import KSPlayer | |
struct BlurView: UIViewRepresentable { | |
var style: UIBlurEffect.Style = .systemMaterial | |
func makeUIView(context: Context) -> UIVisualEffectView { | |
return UIVisualEffectView(effect: UIBlurEffect(style: style)) |
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.Multimedia.ProgressTrack do | |
use MyApp.Schema | |
import Ecto.Changeset | |
import Ecto.Query | |
import Ecto.Changeset | |
alias MyApp.Repo | |
schema "progress_track" do | |
# field(:video_id, :integer) |
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
/* | |
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 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
@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 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 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 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
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 |