Skip to content

Instantly share code, notes, and snippets.

View thewebartisan7's full-sized avatar

Damir thewebartisan7

  • Localhost
View GitHub Profile
@thewebartisan7
thewebartisan7 / retrieve-valid-html-attributes.js
Created December 6, 2022 10:50
Retrieve valid HTML attributes
/* eslint-disable no-undef */
/* eslint-disable curly */
/* eslint-disable padded-blocks */
const elementAttributes = {};
// Exception
// tabindex seem to be allowed on any element according to https://www.w3schools.com/tags/att_global_tabindex.asp
// but here https://www.w3.org/TR/html4/index/attributes.html seem not
// So below we add this exception
const allowedAttributes = ['tabindex'];
@thewebartisan7
thewebartisan7 / valid-attributes.js
Last active May 20, 2025 01:40
All valid HTML attributes by element
/**
* List of valid HTML attributes that will be passed to first node of component or
* to the node with an attribute 'attributes'.
* Generated from https://www.w3.org/TR/html4/index/attributes.html
*
* @see https://jsfiddle.net/1r8czt2h/
*/
module.exports = {
elementAttributes: {
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\File;
use Tightenco\Ziggy\Ziggy;
class GenerateRoutesCommand extends Command
{
@thewebartisan7
thewebartisan7 / recursion.js
Created October 1, 2021 06:15 — forked from bendc/recursion.js
Functional loop
const loop = (() => {
const recur = (callback, count, i=0) => {
if (i == count-1) return callback(i);
callback(i);
return recur(callback, count, i+1);
};
return (callback, count) => {
if (count > 0) return recur(callback, count);
};
})();
{
"data":{
"articles":[
{
"id":39550,
"title":"Eum dolorem est maxime voluptas deleniti dicta repellat corrupti dolor ab.",
"summary":"I don't keep the same size for ten minutes together!' 'Can't remember WHAT things?' said the Caterpillar. Alice folded her hands, and she told her sister, as well wait, as she could, for the.",
"body":"Lizard as she was quite impossible to say than his first speech. 'You should learn not to make ONE respectable person!' Soon her eye fell on a three-legged stool in the pictures of him), while the rest of it appeared. 'I don't much care where--' said Alice. 'Why, there they are!' said the Mouse, sharply and very angrily. 'A knot!' said Alice, 'we learned French and music.' 'And washing?' said the Mouse with an anxious look at me like a writing-desk?' 'Come, we shall have to ask help of any that do,' Alice said nothing; she had expected: before she came upon a Gryphon, lying fast asleep in the way the people that w
@thewebartisan7
thewebartisan7 / gist:c5aff61aee00878e2eb0e8c2a75ba989
Created April 22, 2021 19:53
Authenticate Token Controller Laravel Sanctum
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Validation\ValidationException;
use App\Models\User;
use App\Http\Resources\UserResource;
@thewebartisan7
thewebartisan7 / gist:67f271d1d6caebfb818c693f0aa05869
Created April 22, 2021 19:51
Authenticate Session Controller Laravel Sanctum
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Validation\ValidationException;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Auth\Events\Lockout;
<?php
namespace Laraloop\Frontend\Http\Controllers;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use Illuminate\Validation\ValidationException;
.container,
.container-fluid,
.container-xxl,
.container-xl,
.container-lg,
.container-md,
.container-sm {
width: 100%;
padding-right: var(--bs-gutter-x, 0.75rem);
padding-left: var(--bs-gutter-x, 0.75rem);
<?php
namespace App\Api\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\User;
use Spatie\QueryBuilder\QueryBuilder;
use App\Api\Http\Resources\User as UserResource;
use App\Api\Http\Resources\UserCollection;
use App\Api\Http\Requests\UserCreateRequest;