Skip to content

Instantly share code, notes, and snippets.

View DanielSousa's full-sized avatar

Daniel Sousa DanielSousa

View GitHub Profile
@DanielSousa
DanielSousa / README.md
Created August 15, 2023 09:21 — forked from erikhansen/README.md
Running Warden on Windows with WSL 1 & 2

Running Warden on Windows with WSL 2

See this Github comment thread for any issues or additional context for getting Warden running on Windows with WSL 2.

The instructions below cover how to install Warden on Windows, using WSL 2.

  1. Install Ubuntu 20 LTS in WSL 2
    1. To access the shell/terminal inside of Ubuntu WSL, open the Ubuntu 20.04 program that will have been installed in the step above (If you want to be able to copy/paste, see here. Going forward, this article assumes you will run all commands inside of the Ubuntu terminal
  2. Install Docker Desktop (these instructions were tested using Docker 4.9.0 on June 13th, 2022)
  3. Install homebrew `
@DanielSousa
DanielSousa / .0-MAGENTO-CLOUD-HELPER-SCRIPTS.md
Created July 16, 2021 13:13 — forked from pinkeen/.0-MAGENTO-CLOUD-HELPER-SCRIPTS.md
Helper scripts for Magento Commerce Cloud prod/stage envs

Magento Cloud helper scripts

I drop them into the root project's dir and push them to the repo. Mostly they should use whatever env you've got checked out with magento-cloud command.

Tested only on Mac with Pro/Stage envs, use at your own risk YMMV.

Tip: You can adjust .gitignore like this for convenience:

@DanielSousa
DanielSousa / startup_tools.md
Created May 18, 2021 14:23 — forked from cedrickchee/startup_tools.md
Curated directory of the best startup tools

Here are the best startup tools of 2019 that will help you build out your startup business as quickly, cheaply, and efficiently as possible.

This is a curated list of tools for everything from productivity to web hosting to development tools to designing. Most of these tools are either free or have limited free option that is enough for startups. We love all the free services out there, but it would be good to keep it on topic. It's a bit of a grey line at times so this is a bit opinionated; feel free to suggest and contribute in this list.

Source Code Repos

  • GitHub — Unlimited public repositories and unlimited private repositories (up to 3 collaborators).
  • GitLab — Unlimited public and private Git repos with unlimited collaborators.
  • BitBucket — Unlimited public and private repos (Git and Mercurial) for up to 5 users with Pipelines for CI/CD.
  • Visual Studio — Unlimited private repos (Git a
@DanielSousa
DanielSousa / magento2.xml
Created January 5, 2021 00:33 — forked from philbirnie/magento2.xml
Magento 2 Code Styles for PHPStorm
<code_scheme name="Magento 2" version="173">
<PHPCodeStyleSettings>
<option name="ALIGN_KEY_VALUE_PAIRS" value="true" />
<option name="ALIGN_PHPDOC_PARAM_NAMES" value="true" />
<option name="ALIGN_PHPDOC_COMMENTS" value="true" />
<option name="ALIGN_ASSIGNMENTS" value="true" />
<option name="PHPDOC_BLANK_LINES_AROUND_PARAMETERS" value="true" />
<option name="PHPDOC_WRAP_LONG_LINES" value="true" />
<option name="LOWER_CASE_BOOLEAN_CONST" value="true" />
<option name="LOWER_CASE_NULL_CONST" value="true" />
@DanielSousa
DanielSousa / 1_product_queries.sql
Last active January 27, 2020 13:13 — forked from erikhansen/1_product_queries.sql
Magento 2 - Remove duplicate store view-specific product and category data
-- catalog_product_entity_datetime
SELECT a.*
FROM (SELECT * FROM catalog_product_entity_datetime) AS a
-- This inner join finds all store view-specific rows that exactly match the global scope value. The b.store_id = 0 conditional is key as it targets the global row
INNER JOIN (SELECT * FROM catalog_product_entity_datetime) AS b ON a.attribute_id = b.attribute_id AND a.row_id = b.row_id AND a.value = b.value AND b.store_id = 0
WHERE a.store_id <> 0
GROUP BY a.attribute_id, a.row_id, a.value, a.store_id;
-- catalog_product_entity_decimal
SELECT a.*
@DanielSousa
DanielSousa / sanitize-magento-database.sql
Created September 12, 2019 10:07 — forked from zlik/sanitize-magento-database.sql
Sanitize Magento database
########################################################################################################################
CREATE FUNCTION SANITIZE_EMAIL (email VARCHAR(255))
RETURNS VARCHAR (255) DETERMINISTIC
RETURN CONCAT(MD5(SUBSTRING(email, 1, LOCATE('@', email) - 1)), LEFT(UUID(), 4), '@example.com');
CREATE FUNCTION GET_RANDOM_FIRSTNAME ()
RETURNS VARCHAR (255) DETERMINISTIC
RETURN ELT(FLOOR(1 + RAND() * 25), 'John', 'Sheldon', 'Lindy', 'Joanna', 'Eric', 'Noah', 'Emma', 'Liam', 'Olivia', 'William', 'Ava', 'Mason', 'Sophia', 'James', 'Isabella', 'Benjamin', 'Mia', 'Jacob', 'Charlotte', 'Michael', 'Abigail', 'Elijah', 'Emily', 'Ethan', 'Harper');
@DanielSousa
DanielSousa / create-user.sh
Last active December 22, 2017 13:50
script to create new users in linux server and add public key
#!/usr/bin/env bash
set -e
NEWUSER=$1
USERPUBKEY=$2
if [ -z "$NEWUSER" ]; then
echo "Username required"
exit 1;
@DanielSousa
DanielSousa / M2 acl.xml
Created December 30, 2016 00:49 — forked from Vinai/M2 acl.xml
My current Magento 2 PHPStorm File Templates (Feb 2016)
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
<resources>
<resource id="Magento_Backend::admin">
</resource>
</resources>
</acl>
</config>