Skip to content

Instantly share code, notes, and snippets.

View Neophen's full-sized avatar

Mykolas Mankevicius Neophen

View GitHub Profile
<?php
namespace App\Providers;
use App\Support\Utils\OctaModal;
use App\Support\Utils\OctaResponse;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\ServiceProvider;
use Inertia\Inertia;
@Neophen
Neophen / readme.md
Last active March 16, 2021 15:12
Spa Error handling

Handle API Errors in vue spa

Code samples for the article

defmodule PentoWeb.UploadLive do
use PentoWeb, :live_view
# @bytes_for_5MB 5_242_880
@bytes_for_5MB 1_000_000
@impl Phoenix.LiveView
def mount(_params, _session, socket) do
socket =
socket
@Neophen
Neophen / marko_image.ts
Last active March 30, 2024 09:17
LiveView Hooks vs WebComponents
export class MarkoNativeShare extends HTMLElement {
pictureElement?: HTMLPictureElement | null
images?: HTMLImageElement[] | null
loaded = false
connectedCallback() {
this.pictureElement = this.querySelector('picture')
if (!this.pictureElement) {
throw new Error('<x-image>: requires a <picture> element')
}
@Neophen
Neophen / height_tracker_hook.ts
Last active October 29, 2024 18:28
Phoenix LiveViewHook Class
import { LiveViewHook } from './live_view_hook'
/*
* Tracks height of an element when viewport resizes and sets a variable accordingly.
*
* Used to set the header offset.
*/
class HeightTrackerHook extends LiveViewHook {
private resizeObserver: ResizeObserver | null = null
@Neophen
Neophen / README.md
Last active December 20, 2024 07:46
Better states, plugin for tailwind
@Neophen
Neophen / README.MD
Last active November 2, 2024 13:00
Debug Tailwind CSS utilities
@Neophen
Neophen / README.md
Last active November 24, 2024 09:35
@Neophen
Neophen / Essential Full-Stack Elixir - Phoenix Boilerplate Guide.md
Created November 6, 2024 05:41
Essential Full-Stack Elixir/Phoenix Boilerplate Guide

Essential Full-Stack Elixir/Phoenix Boilerplate Guide

Core Features

1. Authentication & Authorization 🔐

Complete user authentication system including signup, signin, password management, and session handling.

Common Requirements:

  • User registration and login
  • Password reset/recovery