Skip to content

Instantly share code, notes, and snippets.

View AlexanderKharchenko's full-sized avatar
🇺🇸
Miami, USA

Alexander AlexanderKharchenko

🇺🇸
Miami, USA
View GitHub Profile
@blackfyre
blackfyre / GeneralModal.vue
Last active April 3, 2025 21:40
Modals in Laravel Nova Tools
<template>
<modal @modal-close="handleClose">
<form
@submit.prevent="handleConfirm"
slot-scope="props"
class="bg-white rounded-lg shadow-lg overflow-hidden"
style="width: 460px"
>
<slot :uppercaseMode="uppercaseMode" :mode="mode">
<div class="p-8">
@mishterk
mishterk / MagnificPopupModal.vue
Last active December 16, 2021 13:15
Magnific Popup component for VueJS. Modified version of https://gist.github.com/antixrist/11f7d78fe680eb3bc15203a940b6b4f8
<template>
<div class="Modal mfp-hide" ref="modal">
<div class="Modal__inner">
<slot></slot>
</div>
</div>
</template>
@claudiosanches
claudiosanches / plugin.php
Created May 2, 2017 22:33
WooCommerce - Send "New User Registration" email to admins when new customer is created.
<?php
/**
* Send "New User Registration" email to admins when new customer is created on WooCommerce.
*
* @param int $id New customer ID.
*/
function my_wc_customer_created_notification( $id ) {
wp_new_user_notification( $id, null, 'admin' );
}
@epcim
epcim / update-ca-certificates.md
Last active March 14, 2025 17:32
trusted certificates system update-ca-certificates

Adding trusted root certificates to the server

Mac OS X

sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/new-root-certificate.crt
sudo security delete-certificate -c "<name of existing certificate>"

Windows

certutil -addstore -f "ROOT" new-root-certificate.crt

@azimidev
azimidev / _Laravel_Queue_Supervisor_Instruction.md
Last active April 18, 2025 17:05 — forked from danharper/a.md
Laravel Queue Supervisor

Install Supervisor with sudo apt-get install supervisor in Unix or brew install supervisor in Mac OSX. Ensure it's started with sudo service supervisor restart in Unix or brew services start supervisor in Mac OSX.

In Unix in /etc/supervisord/conf.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

In Mac OSX first run supervisord -c /usr/local/etc/supervisord.ini and in /usr/local/etc/supervisor.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

This file points at /usr/local/bin/run_queue.sh, so create that file there. Give this execute permissions, too: chmod +x run_queue.sh.

Now update Supervisor with: sudo supervisorctl reread in Unix and with: brew services restart supervisor in MAc OSX . And start using those changes with: sudo supervisorctl update.

@tomysmile
tomysmile / mac-setup-redis.md
Last active April 28, 2025 11:58
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@eniuz
eniuz / install-php5u-on-centos6.sh
Created May 26, 2016 10:18
Install php5u on Centos 6
wget https://centos6.iuscommunity.org/ius-release.rpm; rpm -Uvh ius-release.rpm \
rpm -ivh http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/ius-release-1.0-13.ius.el6.noarch.rpm \
yum install t1lib libtool-ltdl libc-client automake autoconf file libtidy \
yum --disablerepo=* --enablerepo=ius-archive install php53u-mcrypt.x86_64 php53u-xml.x86_64 php53u-soap.x86_64 php53u-mbstring.x86_64 php53u-gd.x86_64 php53u-imap.x86_64 php53u-bcmath.x86_64 php53u.x86_64 php53u-xcache.x86_64 php53u-ioncube-loader.x86_64 php53u-devel.x86_64 php53u-cli.x86_64 php53u-mysql.x86_64 php53u-tidy.x86_64 php53u-common.x86_64
@dtomasi
dtomasi / default
Last active February 17, 2025 02:27
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@mikaelz
mikaelz / delete-all-woocommerce-products.php
Last active November 22, 2024 14:08
Remove all WooCommerce products from database via SQL
<?php
require dirname(__FILE__).'/wp-blog-header.php';
$wpdb->query("DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%')");
$wpdb->query("DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%'");
$wpdb->query("DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy)");
$wpdb->query("DELETE FROM wp_term_relationships WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_posts WHERE post_type IN ('product','product_variation')");
@nivv
nivv / PHP 7 - Installing imagick on Ubuntu 14.04.md
Last active November 28, 2021 11:38
Guide - Enable imagick on PHP7

Guide

Note The extension Imagick is now included in Ondrej's PPA. All you need to do now is $ sudo apt-get install php-imagick, and you're done. I'll keep the guide here because a lot of it is still true for other extensions

======

I've installed PHP7 via Ondrej's PPA. He maintains these PPA's on his free time, consider donating

Install dependencies