Skip to content

Instantly share code, notes, and snippets.

View mahmoudissmail's full-sized avatar

Mahmoud ismail mahmoudissmail

View GitHub Profile
@hslatman
hslatman / magento_custom_index.php
Last active November 1, 2019 11:55
Custom Magento re-indexing script
<?php
/******************************************************************************************************************
* Source: http://www.emvee-solutions.com/blog/magento-custom-reindex-script/
*
* Custom Magento re-indexing script
******************************************************************************************************************/
//Place this file in your Magento root folder, or modify the require once to match your directory.
@ozexpert
ozexpert / ionic2.image-cache.directive.ts
Last active February 21, 2024 11:13
AngularJS2 / Ionic2 : ImageCache Directive to use with imgcache.js
import { Directive, ElementRef, Input } from '@angular/core';
declare var ImgCache: any;
@Directive({
selector: '[image-cache]'
})
export class ImageCacheDirective {
constructor (
private el: ElementRef
@tomysmile
tomysmile / mac-php-composer-setup.md
Created July 11, 2016 10:45
Setup PHP Composer using Brew
@godriccao
godriccao / create.php
Last active June 3, 2021 15:37 — forked from TheFrankman/create.php
Programatically create an order in Magento 2.1
<?php
/**
* @author Godric Cao
*/
namespace Vendor\Namespace\Model\Subscription\Order;
class Create
{
public function __construct(
\Magento\Framework\App\Helper\Context $context,
@sergiojovanig
sergiojovanig / magento2-clear.sql
Last active January 15, 2024 12:25
Magento 2 Clear Database
##########################################################
# 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`;
@MohammadaliMirhamed
MohammadaliMirhamed / PhpFireBaseNotificationSample.php
Last active May 28, 2024 11:37
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
<?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',
@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
<?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();
@ethicka
ethicka / localhost-ssl-certificate.md
Last active February 18, 2024 16:29
Localhost SSL Certificate on Mac OS

🚨 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

@ipascual
ipascual / jenkins - magento2 deployment script
Created March 8, 2018 20:07
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
# ----------------------------------------------------
@ianitsky
ianitsky / Data.php
Created August 9, 2018 19:06
Magento - Add textarea to admin system config tables
<?php
/**
* Use
*/
class Module_Adminhtml_Block_Config_Data extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
{
protected $_textareaRenderer;
public function __construct()
{