Skip to content

Instantly share code, notes, and snippets.

@yakserr
yakserr / gmap.html
Created September 6, 2024 17:57
dynamic embeded googlemap with Iframe
<div style="width: 960px;">
<iframe
width="600"
height="450"
src="https://www.google.com/maps?q=${lat.value},${lng.value}&hl=es;z=14&output=embed"
style="border:0;"
allowfullscreen=""
loading="lazy">
</iframe>
</div>
@yakserr
yakserr / sail.sh
Created July 25, 2024 07:56
laravel sail got error in permission in folder using Ubuntu PopOs
# start sail
sail up
# open in other terminal and start sail shell (from docker container)
sail shell
# change storage permissions
chmod -R 777 /var/www/html/storage
chown -R www-data:www-data /var/www/html/storage
# restart sail app
exit
@yakserr
yakserr / UIHelper.vue
Created April 19, 2024 00:19
Screen helper to develop responsive in Nuxt x Nuxt UI
<script lang='ts' setup>
const { width, height } = useWindowSize()
const { public: { showDebugger, siteURL, sanityEnv } } = useRuntimeConfig()
const source = computed(() => `${siteURL} - ${sanityEnv} - ${width.value}x${height.value} - ${navigator.userAgent} - ${navigator.language}`)
const { copy } = useClipboard({ source })
</script>
<template>
<div v-if="showDebugger" class="fixed bottom-5 left-5 z-50 flex items-center space-x-2 rounded-full bg-black px-2.5 py-1 font-mono text-xs font-medium text-white border-2 border-blue-500">
@yakserr
yakserr / app.js
Created October 25, 2022 10:39
Dropdown dependenciees
<!-- BEGIN: JS Assets-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.1/jquery.min.js"
integrity="sha512-aVKKRRi/Q/YV+4mjoKBsE4x3H+BkegoM/em46NNlCqNTmUYADjBbeNefNxYV7giUp0VxICtqdrbqU7iVaeZNXA=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!-- END: JS Assets-->
<script>
function onChangeSelect(url, id, name) {
$.ajaxSetup({
headers: {
@yakserr
yakserr / UpdateUserRequest.php
Created October 21, 2022 08:03
Form validation in laravel
<?php
namespace App\Http\Requests\User;
use Illuminate\Validation\Rule;
use Illuminate\Foundation\Http\FormRequest;
class UpdateUserRequest extends FormRequest
{
/**
@yakserr
yakserr / AppServiceProvider.php
Created June 14, 2022 11:07
Add Custom Validation in laravel that accept only alphabet and whitespace
<!-- 1 -->
<!-- add your costum validation in function boot -->
<!-- location file : app/Providers/AppServiceProvider.php -->
<!-- Don't forget to add : use Illuminate\Support\Facades\Validator -->
/**
* Bootstrap any application services.
*
* @return void
*/
@yakserr
yakserr / index.html
Last active June 14, 2022 07:29
Preview Image in Form
<!-- jsfiddle : https://jsfiddle.net/yakser/7ove0ky8/2/ -->
<!-- in production, please install Tailwind CSS instead of CDN -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<!-- Tailwind CSS CDN -->