Skip to content

Instantly share code, notes, and snippets.

View Ferrmolina's full-sized avatar
⛏️

Fernando Molina Ferrmolina

⛏️
View GitHub Profile
const sleepNow = (delay) => new Promise((resolve) => setTimeout(resolve, delay))
async function repeatedGreetingsLoop() {
for (let i = 1; i <= 5; i++) {
await sleepNow(1000)
console.log(`Hello #${i}`)
}
}
repeatedGreetingsLoop()
@SpencerRohan
SpencerRohan / WebsiteAndStoreCreator.php
Last active January 11, 2022 02:15 — forked from 0-Sony/WebsiteAndStoreCreator.php
Magento 2 : Create Programmatically Website/Store/StoreGroup
<?php
namespace XX\StoreBuilder\Setup;
/**
* Class InstallData
* @package XX\StoreBuilder\Setup
*/
use Magento\Framework\Event\ManagerInterface;
@ericrisler
ericrisler / magento2_eav_attribute_reference.md
Last active March 18, 2021 13:15
References related to EAV Attribtues in Magento 2

The array of data you can pass to the \Magento\Eav\Setup\EavSetup::addAttribute() method is as follows:

Some of the attribute keys are remapped using the Magento\Eav\Model\Entity\Setup\PropertyMapper class. We indicate what it's mapped to in [] brackets

$data = [
     'type' => 'varchar',  
          // (string)[eav_attribute][backend_type]: database storage type (varchar|int|text|decimal)
     'backend' => NULL,      
          // (string)[eav_attribute][backend_model]: class name used to retrieve/save the attribute data to the db
     'frontend' => NULL,     
@evgv
evgv / mage_get_order_shipment_information.md
Last active July 17, 2018 19:50
Magento. Get order shipment information.

Get order shipment information

Orders in Magento doesn't have a shipping date. They have shipments, and each one of them have a creation date.

You can access an order shipments using

$order->getShipmentsCollection();
@dfelton
dfelton / 000 - Magento Installer Script Quick Reference Guide.md
Last active September 16, 2019 19:51
Magento - Quick Reference Guide for creating new attributes via an installer script for EAV and flat table entity types.
@jzahedieh
jzahedieh / customer-install-0.1.0.php
Last active December 27, 2018 16:30
Magento Customer Attribute Setup
<?php
/* @var $installer Mage_Customer_Model_Resource_Setup */
$installer = Mage::getResourceModel('customer/setup','customer_setup');
$installer->startSetup();
if (!$installer->getAttributeId('customer', 'attribute_name')) {
$installer->addAttribute('customer', 'attribute_name', array( // TABLE.COLUMN: DESCRIPTION:
/** Standard values defined @see Mage_Eav_Model_Entity_Setup::_prepareValues() */
'label' => 'Label', // eav_attribute.frontend_label admin input label
'backend' => 'module/class_name', // eav_attribute.backend_model backend class (module/class_name format)
@wbroek
wbroek / genymotionwithplay.txt
Last active February 12, 2024 03:22
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@apisandipas
apisandipas / _html_entities.scss
Created January 14, 2014 16:02
HTML Entities map - The pseudo-element 'content' property doesnt accept normal (&raquo;) style HTML entities. These variables below easy the pain of looking up the HEX codes...
/**
* The pseudo-element 'content' property doesnt accept normal (&raquo;) style
* HTML entities. These variables below easy the pain of looking up the HEX codes...
*
* Referenced from http://www.danshort.com/HTMLentities/
*
* TODO: Add all the other entities? Worth it? Some day? Maybe?
*/
// Punctuation
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@arosenhagen
arosenhagen / magento-code-snippets.md
Last active April 8, 2024 09:21
[magento] - code snippets

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name