Skip to content

Instantly share code, notes, and snippets.

View roma-glushko's full-sized avatar
🦁
Hacking my way to the promised land

Roman Glushko roma-glushko

🦁
Hacking my way to the promised land
View GitHub Profile
@vasilii-b
vasilii-b / cli-find-files-and-run-script-on-then.sh
Created April 20, 2020 14:02
Linux CLI: find filenames and execute a command on the files (without file extension)
#!/bin/bash
# get files without the extension
files=$(find ./ -name "filename*.html" -execdir basename {} .html \;)
for FILENAME in ${files}
do
#some-command-with-filename-as-param ${FILENAME};
done;
@peterjaap
peterjaap / DB_CLEANUP_WITH_QUOTE_TABLE.php
Last active April 13, 2020 20:46
Updated Magento 2 cleanup script for sensitive data in wishlist_item_option, quote_item_option AND order_item_option (not in original script). Also added try/catch block for unserializable data. See for more info https://support.magento.com/hc/en-us/articles/360040209352 and https://magento.com/security/hot-fix-available-cve-2019-8118
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
use Magento\Framework\App\Bootstrap;
use Magento\Framework\DB\Adapter\AdapterInterface;
use Magento\Framework\DB\Query\Generator;
use Magento\Framework\DB\Select\QueryModifierFactory;
@vasilii-b
vasilii-b / look-for-checkout-layout-change.sh
Last active February 11, 2020 12:12
Look what XML file changes the layout type for a page. Sometimes this is done without intention, but can break the store's desired layout. E.g. for the ckeckout page the default page layout is "checkout". When this get changed to "1column" magic happens.
# command below looks for `checkout_index_index.xml` files that changes the layout
grep -r -i --include \*checkout_index_index.xml "layout="
@magento-docbot
magento-docbot / module-readme-template.md
Last active January 15, 2020 20:08
README template for Magento modules
@amenk
amenk / README.md
Created January 29, 2018 15:07
How To Apply a Magento 2 Patch to your project
  • Find the commit a GitHub
  • Add .patch to the URL
  • Require vaimo/composer-patches
  • Add an entry like the above, with path-removal-level 5, to the composer.json
@petenelson
petenelson / ssh-mysql-tunnel-test.php
Created July 13, 2017 16:10
WordPress: MySQL PDO command via SSH tunnel
<?php
/**
* Plugin Name: SSH Remote Test
*/
add_action( 'admin_init', 'ssh_remote_test', 1 );
function ssh_remote_test() {
@tadast
tadast / Paint slack black.md
Last active July 14, 2023 04:00
Update the Mac Desktop slack CSS

In the console

export SLACK_DEVELOPER_MENU=true
open /Applications/Slack.app

In slack UI

right-click on anything -> inspect element

@BrunoGrandePhD
BrunoGrandePhD / remove-big-file.sh
Created December 15, 2016 01:16
Remove a large committed file from your Git repository.
# The commands below are a guide to remove a large file that has been
# accidentally committed to a Git repository's history. If the file is
# larger than 100 MB, GitHub will prevent you from pushing your latest
# commits. The annotated steps below should help you remove the large
# file from your commit history, even if you've made new commit since.
# Some Git users advise against rebasing. You can safely use it here
# because you haven't published your changes yet.
# So, you first need to rebase your current branch onto the point that

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@nicksantamaria
nicksantamaria / fork-example.php
Created October 20, 2016 22:35
Example: Parallel processing in PHP using pcntl_fork()
<?php
/**
* @file
* Basic demonstration of how to do parallel threads in PHP.
*/
// This array of "tasks" could be anything. For demonstration purposes
// these are just strings, but they could be a callback, class or
// include file (hell, even code-as-a-string to pass to eval()).