Skip to content

Instantly share code, notes, and snippets.

View texboy's full-sized avatar

Victor Barcellos texboy

  • https://github.com/Atwix
View GitHub Profile
@texboy
texboy / .zshrc
Last active March 5, 2020 17:19
My zshrc (Based on LukeSmithxyz zoomer shell config)
# Luke's config for the Zoomer Shell
#Enabling blur
if [[ $(ps --no-header -p $PPID -o comm) =~ '^yakuake|konsole$' ]]; then
for wid in $(xdotool search --pid $PPID); do
xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -id $wid; done
fi
# Enable colors and change prompt:
autoload -U colors && colors
@texboy
texboy / utils.md
Last active October 5, 2021 14:30
Commands and utilities for linux

Commands and utilities

Create new has for magento 2 password

    php -r '$salt=md5(time());
    echo hash("sha256", $salt.$argv[1]).":$salt:1\n";' mypassword

Dump cms content query

    mysqldump --column-statistics=0  -u<user> -p<password> -h<host> -P<port> database cms_block cms_block_store sequence_cms_block cms_page cms_page_store sequence_cms_page > ../cms.sql
function had {
case $1 in
## list ip of container specific
'dip')
if [ $# -eq 2 ]; then
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $2
else
echo "=[ Parameters ]==============================================="
@texboy
texboy / composer-patches.md
Last active January 8, 2025 12:38
How to apply git patches using composer on a magento 2 project.

Introduction

Patches are great for small bugfixes since they're easy to create and maintain. You should follow magento's official documentation to install the required composer plugin. Don't forget to add the required patch section on your composer.json or composer will not be able to see your patches.

Getting started

Create a repo to start the creation of a patch.

  1. Go inside the folder that the file you need to fix is.
  2. Execute the git init . command.
  3. Execute the git add -A . command.
  4. Commit something. Ex: git commit -m "start of patch"