Skip to content

Instantly share code, notes, and snippets.

View markshust's full-sized avatar
🤓
Currently exploring building production apps with Claude Code & AI.

Mark Shust markshust

🤓
Currently exploring building production apps with Claude Code & AI.
View GitHub Profile
@markshust
markshust / catalog_dump.sql
Created March 7, 2019 23:57
magento2 dump all catalog tables
mysqldump -h db -umagento -pmagento magento catalog_category_entity catalog_category_entity_datetime catalog_category_entity_decimal catalog_category_entity_int catalog_category_entity_text catalog_category_entity_varchar catalog_category_product catalog_category_product_cl catalog_category_product_index catalog_category_product_index_replica catalog_category_product_index_store1 catalog_category_product_index_store1_replica catalog_category_product_index_store2 catalog_category_product_index_store2_replica catalog_category_product_index_store7 catalog_category_product_index_store7_replica catalog_category_product_index_tmp catalog_compare_item catalog_eav_attribute catalog_product_attribute_cl catalog_product_bundle_option catalog_product_bundle_option_value catalog_product_bundle_price_index catalog_product_bundle_selection catalog_product_bundle_selection_price catalog_product_bundle_stock_index catalog_product_category_cl catalog_product_entity catalog_product_entity_datetime catalog_product_entity_decima
@markshust
markshust / .bash_profile
Created June 11, 2019 19:32
start google cloud functions framework with npx and the target function name of your current working directory
# Add to your ~/.bash_profile file and start a new terminal session
alias ff="npx @google-cloud/functions-framework --target=${PWD##*/}"
# Run by going to your google cloud function directory:
cd ~/Sites/myGoogleFunction
# then run:
ff
@markshust
markshust / gist:8de123470cc98151bb3402c7c04bee8f
Created October 14, 2019 20:34 — forked from piotrekkaminski/gist:9bc45ec84028611d621e
How to automatically download patches and release of Magento
1) First you need to generate download token. Login to your account on magento.com and generate it in Account Settings->Downloads Access Token
2) You will need your MAGEID as well. It is shown at the top-left in your account page.
3) curl -k https://MAGEID:[email protected]/products/downloads/info/help
4) Profit!
@markshust
markshust / tailwind.config.js
Last active January 30, 2021 13:58
Original defaultTheme for tailwindcss 1
const colors = require('./tailwind.theme1.colors')
module.exports = {
...
theme: {
colors,
...
@markshust
markshust / Subdomain.php
Last active November 14, 2020 14:54
Add subdomain to the Request object.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
class Subdomain
{
/**
@markshust
markshust / restore.sh
Created December 23, 2020 14:18
Helper script to sync dev environments with prod
#!/bin/bash
bin/restart
echo "Restoring database from backup..."
bin/clinotty mysql -h db -u root -pmagento magento < backups/latest.sql
rsync -av username@hostname:/var/www/html/pub/media/wysiwyg/ src/pub/media/wysiwyg/
rsync -av username@hostname:/var/www/html/pub/media/ src/pub/media/ --exclude=import --exclude=tmp --exclude=cache --exclude=captcha
bin/composer install
bin/patch
@markshust
markshust / restorestaging.sh
Created December 23, 2020 14:24
Simple bash script to sync Magento staging with production (from dev machine)
#!/bin/bash
echo "Restoring database from backup..."
ssh user@staging mysql -h127.0.0.1 -uusername -ppassword -f dbname < backups/latest.sql
# sync images from prod > local
rsync -av user@production:/var/www/html/pub/media/wysiwyg/ src/pub/media/wysiwyg/
rsync -av user@production:/var/www/html/pub/media/ src/pub/media/ --exclude=import --exclude=tmp --exclude=cache --exclude=captcha
# sync images from local > stage
rsync -av src/pub/media/wysiwyg/ user@staging:/var/www/html/pub/media/wysiwyg/
@markshust
markshust / TurnOffLiveChat.AppleScript
Last active February 28, 2021 11:39
macOS Automator script to turn on and off LiveChat every day on schedule
tell application "Google Chrome"
tell window 1
tell active tab
delay 7
set str to execute javascript "if (!document.querySelector('#notifications-bar button')) document.querySelector('span.lc-switch.lc-switch--compact.addition > input').click();"
delay 3
tell application "System Events" to keystroke "w" using command down
end tell
end tell
end tell
@markshust
markshust / hosts
Last active December 26, 2024 10:11
Notion DNS servers in the event of an outage...
# Add the following records to your DNS config
## Mac: /etc/hosts
## Windows: C:\Windows\System32\drivers\etc\hosts
104.18.23.110 admin-stg.notion.so
104.18.23.110 aif.notion.so
104.18.23.110 analytics-iframe.notion.so
104.18.23.110 analytics.pgncs.notion.so
104.18.23.110 api.notion.so
104.18.23.110 api.pgncs.notion.so
104.18.23.110 dev.notion.so
@markshust
markshust / anything.sh
Created February 15, 2021 20:16
Debug bash scripts with xtrace
#!/bin/bash
set -o xtrace