Skip to content

Instantly share code, notes, and snippets.

View 0m3r's full-sized avatar

Oleksandr Krasko 0m3r

View GitHub Profile
@0m3r
0m3r / README.md
Last active January 9, 2024 10:42
Install all swissup modules and theme oneline command
curl -s https://gist.githubusercontent.com/0m3r/02a416bea76ceedbc71f1063e7e0c26e/raw/e4e82030084a520987a3169991678315ec38d394/command | bash -s
@0m3r
0m3r / Readme.md
Last active August 5, 2021 07:57
Oneline cli command to enable and configure swissup/module-pagespeed options

Pagespeed QuickStart

curl -s https://gist.githubusercontent.com/0m3r/a39f76844c465ff1e67d36eaff70592a/raw/9439135646dda8e95fd418f07b283b0efe682d3c/configure | bash -s
php bin/magento cache:flush
php bin/magento config:set pagespeed/main/enable 1
php bin/magento config:set pagespeed/main/devmode 1
@0m3r
0m3r / README.md
Last active May 21, 2021 11:23
Fast deploy for all Swissup modules (for developer only)

Fast deploy for all Swissup modules (for developer only)

Usage

(curl -s https://gist.githubusercontent.com/0m3r/954fc98bda36f90e4580e7eee641cc05/raw/b327e5644af562a403b26ff8bf44504192e20e65/install.bash > install.bash) && chmod +x install.bash && ./install.bash && rm -rf install.bash

Warning

Doesn't work without access to private SwissupLabs GitHub Repos

@0m3r
0m3r / README.md
Last active December 30, 2020 07:01
Magento 2.3.2 and php 7.3 Fixing
@0m3r
0m3r / README.md
Last active April 6, 2020 10:10
find FTP credentials in basecamp ticket and paste into Filezilla
  1. Open your basecamp ticket
  2. open js console and run this js code in console
    var text = jQuery('.formatted_content').eq(0).text();

    var startr = "(^|<div>|<br>)\\s*";
    var delimiterr = "(\\s|&nbsp;)*[:-]*(\\s|&nbsp;)*";
    var endr = "\\s*($|&nbsp;|<\/div>|<br>)";

 var rhost = new RegExp(startr + "(host|domain|server)+" + delimiterr + "([a-z0-9.]{3,})" + endr, "img");
@0m3r
0m3r / README.md
Last active April 1, 2020 10:58
Add vaimo/composer-patches from console.

Php workarounds for weary travelers composer/composer#8353

curl -s https://gist.githubusercontent.com/0m3r/16241092b5839345216dcdb1408baaae/raw/add_vaimo_patch.bash | sha1sum 
910c77732701413018898d314dc073600833599e

curl -s https://gist.githubusercontent.com/0m3r/16241092b5839345216dcdb1408baaae/raw/add_vaimo_patch.bash | bash -s "vendor/module-package" "Path title #1" http://re.ro/path.diff

curl -s https://gist.githubusercontent.com/0m3r/16241092b5839345216dcdb1408baaae/raw/add_vaimo_patch.bash | bash -s "vendor/module-package" "Path title #1" "source":"http://re.po/1.diff","version":">2.3.1 <= 2.4","sha1":"@123"
@0m3r
0m3r / Find_and_diff_README.md
Last active January 23, 2020 11:11
Find modified files in package and save diff

How to Find Recently Modified Files/Folders in Linux

state ./vendor/swissup/module-pagespeed/composer.json 
find ./vendor/swissup/module-pagespeed/ -type f -mtime -50 -ls
...
1706938   16 -rw-rw-rw-   1 www-data www-data    13931 Dec 12 13:59 ./vendor/swissup/module-pagespeed/Helper/Config.php

Download original

Usage examples :

curl -s https://gist.githubusercontent.com/0m3r/eff7ff873713e7e7223f08c1e7020f35/raw/9b1fe9263a7d64ad7c0869af04b6cf51cd5d319f/detector.sh | bash -s 2.2.0 magento/framework

curl -s https://gist.githubusercontent.com/0m3r/eff7ff873713e7e7223f08c1e7020f35/raw/9b1fe9263a7d64ad7c0869af04b6cf51cd5d319f/detector.sh --output detector.sh

cat detector.sh | bash -s 2.2.0,2.3.0 magento/framework,magento/module-store
cat detector.sh | bash -s magento/product-community-edition 2.2.0,2.3.0 magento/framework,magento/module-store
#!/bin/bash
if test "$#" -eq 3; then
PACKAGE=${1}
VERSION=${2}
REQUIRE=${3}
else
PACKAGE="magento/product-community-edition"
VERSION=${1}
REQUIRE=${2}
@0m3r
0m3r / onlinesetup
Last active April 25, 2019 08:21
OnlineSetup bash script (curl -s [raw url] | bash -s)
#!/bin/bash
DOMAIN=${1:-magento.local}
VERSION=${2:-2.3.1}
REPO=${3:-https://repo.magento.com/}
# REPO=${3:-git@github.com:magento/magento2.git}
DIR=$DOMAIN
# Check availability of composer
hash composer 2>/dev/null || { echo >&2 "The script requires \"composer\" (https://getcomposer.org/download/)"; exit 1; }