Skip to content

Instantly share code, notes, and snippets.

View diazwatson's full-sized avatar

Raul Watson diazwatson

View GitHub Profile
@diazwatson
diazwatson / .n98-magerun.yaml
Created February 6, 2016 12:18
.n98-magerun spanish config
commands:
N98\Magento\Command\Installer\InstallCommand:
installation:
defaults:
currency: EUR
locale: es_ES
timezone: Europe/Madrid
use_secure: no
use_rewrites: yes
session_save: files
@diazwatson
diazwatson / .n98-magerun2.yaml
Created February 6, 2016 12:20
n98-magerun2 spanish config
commands:
N98\Magento\Command\Installer\InstallCommand:
installation:
defaults:
currency: EUR
locale: es_ES
timezone: Europe/Madrid
use-secure: 0
use-rewrites: 1
session-save: files
@diazwatson
diazwatson / blockchain ID
Created July 13, 2016 00:03
blockchain ID
Verifying that +diazwatson is my blockchain ID. https://onename.com/diazwatson
@diazwatson
diazwatson / ask.sh
Created July 22, 2016 00:02
Bash: General-purpose Yes/No prompt function ("ask")
# This is a general-purpose function to ask Yes/No questions in Bash, either
# with or without a default answer. It keeps repeating the question until it
# gets a valid answer.
ask() {
# http://djm.me/ask
while true; do
if [ "${2:-}" = "Y" ]; then
prompt="Y/n"
@diazwatson
diazwatson / Magento 1.x Orphaned Records Cleanup.md
Created August 30, 2017 16:39 — forked from dfelton/Magento 1.x Orphaned Records Cleanup.md
Deletes orphaned records from a Magento 1.x database.

Purpose

The purpose of this SQL script is to clean up a Magento 1.x database by deleting orphaned records from database tables which cause foreign key contraint failures. This happens when at some point in time records where deleted from the database while FOREIGN_KEY_CHECKS = 0 and the person performing the delete operations failed to delete all related records pertaining to related tables of the primary table.

This script can be helpful when encountering foreign key constraint failures using the Data Migration Tool to migrate your

filter:
paths: ["app/code/{vendor-name-goes-here}/*", "vendor/{vendor-name-goes-here}/*"]
excluded_paths:
- "vendor/{vendor-name-goes-here}/{module-name-goes-here}/*"
- "app/code/{vendor-name-goes-here}/{module-name-goes-here}/*"
- '*.min.js'
before_commands:
tools:
php_code_sniffer:
config: { standard: 'Zend,PSR-1,PSR-2' }
@diazwatson
diazwatson / magento.conf
Created March 14, 2018 20:16 — forked from jonathonbyrdziak/magento.conf
A configuration file for magento under nginx.
#####################################################
#
# Provided by the Magento Support Center
# http://magentosupport.help/knowledgebase/configuring-nginx-to-work-with-magento-advanced/
#
# Your Magento Tutorial specialists
#
server {
listen *:8080;
server_name fanatik.redrokk.com www.fanatikbike.com fanatikbike.com;
// This is how you would use it. Pass in your collection
// along with an individual callback as well as a batch callback
Mage::getSingleton('stcore/resource_iterator_batched')->walk(
$collection,
array($this, 'batchIndividual'),
array($this, 'batchAfter'),
self::BATCH_SIZE
);
public function batchIndividual($model)
@diazwatson
diazwatson / InstallData.php
Created August 31, 2018 14:19
Magento2 UK and Ireland Counties for Region Addresses (SetupScript)
<?php
namespace Vendor\ModuleName\Setup;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
class InstallData implements InstallDataInterface
{
#!/bin/bash
PROJECTS_DIR=Sites
[email protected]:magento/magento2.git
[email protected]:diazwatson/magento2.git
[email protected]:magento/adobe-stock-integration.git
[email protected]:diazwatson/adobe-stock-integration.git
ADMIN_USER=jondoe
ADMIN_PASS=magento123