Skip to content

Instantly share code, notes, and snippets.

View mahmoudissmail's full-sized avatar

Mahmoud ismail mahmoudissmail

View GitHub Profile
@nhatnx
nhatnx / curl-error-60-ssl-certificate-unable-to-get-local-issuer-certificate.md
Last active February 20, 2024 03:35
[WAMP] cURL error 60: SSL certificate: unable to get local issuer certificate
View curl-error-60-ssl-certificate-unable-to-get-local-issuer-certificate.md

Need to do this in both php.ini files !!!

Attention Wamp/Wordpress/windows users. I had this issue for hours and not even the correct answer was doing it for me, because i was editing the wrong php.ini file because the question was answered to XAMPP and not for WAMP users, even though the question was for WAMP.

here's what i did

Download the certificate bundle.

Put it inside of C:\wamp64\bin\php\your php version\extras\ssl

@James-Bovis
James-Bovis / StickyFooter.html
Created September 12, 2019 18:42
Butternut Box - Sticky Footer
View StickyFooter.html
<div class="sticky-footer">
<a href="#" class="sticky-footer__item sticky-footer__item--active">
<img src="#" alt="Dashboard Icon">
Dashboard
</a>
<a href="#" class="sticky-footer__item">
<img src="#" alt="Dashboard Icon">
My Plan
</a>
<a href="#" class="sticky-footer__item">
@vmasciotta
vmasciotta / ImageResize.php
Created August 22, 2019 14:06
Fix error catalog placeholder Magento 2.3 - https://github.com/magento/magento2/issues/19710
View ImageResize.php
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
namespace Magento\MediaStorage\Service;
use Magento\Catalog\Helper\Image as ImageHelper;
@ananth-iyer
ananth-iyer / CsrfValidatorSkip.php
Last active October 30, 2023 10:33
Magento 2.3.0: Implement below code to skip the CSRF check on your custom route called outside Magento environment. This implementation does not break core frontend/adminhtml routes, Magento 2.3/2.2/2.1 web stores.
View CsrfValidatorSkip.php
<?php
namespace Vendor\Module\Plugin;
class CsrfValidatorSkip
{
/**
* @param \Magento\Framework\App\Request\CsrfValidator $subject
* @param \Closure $proceed
* @param \Magento\Framework\App\RequestInterface $request
* @param \Magento\Framework\App\ActionInterface $action
@ianitsky
ianitsky / Data.php
Created August 9, 2018 19:06
Magento - Add textarea to admin system config tables
View Data.php
<?php
/**
* Use
*/
class Module_Adminhtml_Block_Config_Data extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
{
protected $_textareaRenderer;
public function __construct()
{
@ipascual
ipascual / jenkins - magento2 deployment script
Created March 8, 2018 20:07
jenkins - magento2 deployment script
View jenkins - magento2 deployment script
#!/bin/bash
# ----------------------------------------------------
# v. 20180308
TARGET=/var/www/html
TMPTARGET=/var/www/codedeploy
BACKUP=/var/www/html-backup
USER=apache
GROUP=apache
# ----------------------------------------------------
@ethicka
ethicka / localhost-ssl-certificate.md
Last active February 18, 2024 16:29
Localhost SSL Certificate on Mac OS
View localhost-ssl-certificate.md

🚨 2020 Update: I recommend using mkcert to generate local certificates. You can do everything below by just running the commands brew install mkcert and mkcert -install. Keep it simple!


This gives you that beautiful green lock in Chrome. I'm assuming you're putting your SSL documents in /etc/ssl, but you can put them anywhere and replace the references in the following commands. Tested successfully on Mac OS Sierra and High Sierra.

Set up localhost.conf

sudo nano /etc/ssl/localhost/localhost.conf

@nklatt
nklatt / create_attributes.php
Last active May 14, 2020 07:45
Programmatically add new product attribute with options to a Magento 2 store and add to Default attribute group
View create_attributes.php
<?php
defined('STDIN') or die(_("Access Denied. CLI Only"));
// execute from the command line: php <path to magento root>/cli/create_attributes.php
require __DIR__.'/../app/bootstrap.php'; // assuming this file is in /cli under the root magento dir
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
$installer = $bootstrap->getObjectManager()->create('Magento\Catalog\Setup\CategorySetup');
$objectManager = $bootstrap->getObjectManager();
@MohammadaliMirhamed
MohammadaliMirhamed / PhpFireBaseNotificationSample.php
Last active June 24, 2023 07:38
firebase notification sample in php . if you like this code follow me and star it . i will follow you and use your codes and share them . Simple PHP FireBase (FCM) script showing how to send an Android push notification. Be sure to replace the SERVER_API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call
View PhpFireBaseNotificationSample.php
<?php
#API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-SERVER-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = $_GET['id'];
#prep the bundle
$msg = array
(
'body' => 'Body Of Notification',
@sergiojovanig
sergiojovanig / magento2-clear.sql
Last active January 15, 2024 12:25
Magento 2 Clear Database
View magento2-clear.sql
##########################################################
# PRODUCTS
##########################################################
DELETE FROM `catalog_product_bundle_option`;
DELETE FROM `catalog_product_bundle_option_value`;
DELETE FROM `catalog_product_bundle_selection`;
DELETE FROM `catalog_product_entity_datetime`;
DELETE FROM `catalog_product_entity_decimal`;
DELETE FROM `catalog_product_entity_gallery`;
DELETE FROM `catalog_product_entity_int`;