Skip to content

Instantly share code, notes, and snippets.

@Knase
Knase / Magento2-remove-orders-customers
Created June 2, 2023 00:13 — forked from carlowens/Magento2-remove-orders-customers
Magento 2 remove test data of orders and customers
SET FOREIGN_KEY_CHECKS = 0;
#clear orders
TRUNCATE TABLE `gift_message`;
TRUNCATE TABLE `quote`;
TRUNCATE TABLE `quote_address`;
TRUNCATE TABLE `quote_address_item`;
TRUNCATE TABLE `quote_id_mask`;
TRUNCATE TABLE `quote_item`;
TRUNCATE TABLE `quote_item_option`;
TRUNCATE TABLE `quote_payment`;
@Knase
Knase / mount.md
Created August 14, 2023 21:18
Mac OS Mount RW NTFS

Write to NTFS support MacOS

1. Get the partition UUID

Connect the external drive to MacOS. It should mount read-only. Start "System Information", clic on Hardware -> Storage, select your drive in the list and copy its UUID.

Another way to get the UUID is to use the diskutil CLI tool:

~$ diskutil list 
~$ distutil info diskXsY
@Knase
Knase / pkglist.php
Created August 24, 2023 11:42 — forked from alankent/pkglist.php
Connect to Magento 2 Composer repo and list packages you can access
<?php
/**
* Return the path of the auth.json file.
*/
function findAuthJson() {
// Windows sets HOMEDRIVE and HOMEPATH, but cygwin sets HOME.
if (!isset($_SERVER["HOME"]) && isset($_SERVER["HOMEDRIVE"])) {
@Knase
Knase / git-revert-sha-commit
Created March 17, 2024 21:18 — forked from mgibowski/git-revert-sha-commit
[git] revert to a commit by sha hash
# found at:
# http://stackoverflow.com/questions/1895059/git-revert-to-a-commit-by-sha-hash
# reset the index to the desired tree
git reset --hard 56e05fced
# move the branch pointer back to the previous HEAD
git reset --soft HEAD@{1}
git commit -m "Revert to 56e05fced"
@Knase
Knase / fish_install.md
Last active May 29, 2025 07:03 — forked from gagarine/fish_install.md
Install fish shell on macOS with brew

Installing Fish shell on MacOS (Intel and M1) using brew

Fish is a smart and user-friendly command line (like bash or zsh). This is how you can instal Fish on MacOS and make your default shell.

Note that you need the https://brew.sh/ package manager installed on your machine.

Install Fish

brew install fish