Skip to content

Instantly share code, notes, and snippets.

View Neophen's full-sized avatar

Mykolas Mankevicius Neophen

View GitHub Profile
@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
@Neophen
Neophen / README.MD
Last active November 2, 2024 13:00
Debug Tailwind CSS utilities
@Neophen
Neophen / README.md
Last active November 6, 2024 06:12
Better states, plugin for tailwind
@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 / 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')
}
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 / readme.md
Last active March 16, 2021 15:12
Spa Error handling

Handle API Errors in vue spa

Code samples for the article

<?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;