Skip to content

Instantly share code, notes, and snippets.

View gr1zix's full-sized avatar
🎯
Focusing

Grizix gr1zix

🎯
Focusing
View GitHub Profile
@prpanto
prpanto / Image.php
Last active June 20, 2024 15:00
Upload image with Laravel, Inertia, Vue, Filepond and Media Library
<?php
namespace App\Models;
use Spatie\MediaLibrary\HasMedia;
use Illuminate\Database\Eloquent\Model;
use Spatie\MediaLibrary\InteractsWithMedia;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Image extends Model implements HasMedia
@fedegomez
fedegomez / checkTitles.js
Last active May 24, 2023 03:38
Checks if the title of the result in the SERP matches the title of the URL
javascript: (function (doc){var changed=0; function checkTitles(){console.log('jQuery version ', $.fn.jquery, ' loaded'); var position=1; var items=[]; var results=$('#rso .kp-blk .g, #rso .g[class="g"], #rso .srg .g').not('.kno-kp .g').find('div:first').find('a:first'); $('.title-changed, #CountTitlesChanged').remove(); results.each(function (){if (!$(this).parents('.related-question-pair').length){var parent=$(this).closest('.tF2Cxc').length > 0 ? $(this).closest('.tF2Cxc') : $(this).closest('li'); items.push([ position, $(this).find('h3').text(), encodeURI($(this).attr('href')), parent]); position++;}}); var numItems=1; cors_proxies=[ 'https://api.codetabs.com/v1/proxy?quest=', 'https://jsonp.afeld.me/?url=',]; items.forEach(item=>{$.ajax({url: cors_proxies[Math.floor(Math.random() * cors_proxies.length)] + item[2], success: function (data, status, xhr){title=$(data).filter('title').text(); var html='<div class="title-changed">'; if (title !=item[1]){html +='<span style="font-weight: bold;color: #ff6961;">
@mrtcmn
mrtcmn / workaround.css
Created November 27, 2020 15:04
firefox backdrop-filter workaround
@supports (-webkit-backdrop-filter: none) or (backdrop-filter: none) {
.blurred-container {
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
}
}
/* slightly transparent fallback for Firefox (not supporting backdrop-filter) */
@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) {
.blurred-container {
@daltonrooney
daltonrooney / modal-video.vue
Last active April 26, 2024 08:41
Modal video player component for Vue.js
/* Based on https://github.com/appleple/react-modal-video/ */
<template>
<div v-if="isOpen">
<div
:class="classNames.modalVideo"
tabIndex='-1'
role='dialog'
:aria-label="aria.openMessage"
@click="$emit('update:isOpen', false)"
@mcaskill
mcaskill / wp-ajax.php
Last active May 6, 2024 16:20 — forked from yllus/admin-ajax.php
WordPress : A drop-in replacement for admin-ajax.php that is optimized for visitor-only AJAX requests.
<?php
/**
* WordPress Ajax Process Execution
*
* This file is a near-identical copy of {@see wp-admin/admin-ajax.php} from WordPress v6.3.0.
*
* Differences:
* 1. Constant `WP_ADMIN` is set to FALSE, by default.
* 2. WordPress action 'admin_init' is replaced with custom action 'ajax_init'.
* 4. Custom actions hooked on 'admin_init' are not executed.
@echr
echr / app.js
Last active November 23, 2023 12:05
Simple Laravel + Vue + Laravel Mix + Firebase Notification (PWA, Offline)
// FILE PATH: /resources/js/app.js
require('./bootstrap');
// Import Service Worker Registry
require('./extensions/sw-registry');
import Vue from 'vue';
...
@r0lodex
r0lodex / localssl.md
Last active June 5, 2024 23:16
Setting Up Local SSL

Automatic

Updated 24-05-2020

NAME=$1

mkdir $NAME
cd $NAME

# Generate private key
@junaidbhura
junaidbhura / gutenberg-button.js
Created August 17, 2019 05:10
WordPress Gutenberg open button in a new window
/**
* Button.
*/
import wp from 'wp';
const { __ } = wp.i18n;
const { addFilter } = wp.hooks;
const { createHigherOrderComponent } = wp.compose;
const { Fragment, cloneElement } = wp.element;
@rubenRP
rubenRP / AddImageToCompareProductsPlugin.php
Created February 14, 2019 15:44 — forked from denchev/AddImageToCompareProductsPlugin.php
Magento 2 show image in sidebar compare list
<?php
namespace Vendor\Namespace\Plugin;
use Magento\Catalog\Helper\ImageFactory;
use Magento\Catalog\Helper\Product\Compare;
use Magento\Catalog\Model\ProductRepository;
class AddImageToCompareProductsPlugin
{
@gr1zix
gr1zix / phpmyadmin.conf
Last active July 18, 2022 19:44
Laravel LEMP server configurations [Nginx, MySQL PhpMyAdmin, php7.2-fpm, Redis, Composer)
location /phpmyadmin {
root /usr/share/;
index index.php;
try_files $uri $uri/ =404;
location ~ ^/phpmyadmin/(doc|sql|setup)/ {
deny all;
}
location ~ /phpmyadmin/(.+\.php)$ {