Skip to content

Instantly share code, notes, and snippets.

Yao paullbyao

Block or report user

Report or block paullbyao

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@paullbyao
paullbyao / disable-cleanmymac.md
Last active May 8, 2019
Mac disables "Setapp CleanMyMac-setapp.HealthMonitor" launchd services
View disable-cleanmymac.md

sudo vim /private/var/db/launchd.db/com.apple.launchd/overrides.plist

Add the following code,as entries like:

<key>com.macpaw.CleanMyMac-setapp.HealthMonitor</key>
<dict>
<key>Disabled</key>
<true/>
</dict>
View 0001-BUGIFX-Magento-Zend-Framework-1-PHP5.6.patch
From 473846959772d8160b34b92ae3bcecddf24b972f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Julian=20Nu=C3=9F?= <julian.nuss@outlook.com>
Date: Tue, 23 Sep 2014 21:07:29 +0200
Subject: [PATCH 1/1] [BUGIFX] Zend Framework 1 + PHP5.6
---
lib/Zend/Locale/Format.php | 22 +++++++++++-----------
lib/Zend/Service/Audioscrobbler.php | 6 +++---
lib/Zend/Service/Technorati.php | 6 +++---
lib/Zend/Validate/Hostname.php | 4 ++--
@paullbyao
paullbyao / 3-xargs-tips.md
Created Jul 19, 2017 — forked from nepsilon/3-xargs-tips.md
3 xargs usage tips — First published in fullweb.io issue #26
View 3-xargs-tips.md

3 xargs tips on the road to CLI mastery

xargs can be used to process output from other commands (such as find) as argument to a new commands. It can come very handy in many cases, here are 3:

1. Finding and deleting .zip files:

$ find . -name "*.zip" -type f -print | xargs /bin/rm -f 
@paullbyao
paullbyao / how-to-git-merge-commits.md
Created Jul 19, 2017 — forked from nepsilon/how-to-git-merge-commits.md
Git merge commits — First published in fullweb.io issue #30
View how-to-git-merge-commits.md

How to merge commits in Git?

Sometimes, you commit something and realize it needs some more fixing, and then some more. Resulting in 3 or more commits for the same task.

You like to keep your git log clean and want to merge your commits. Here is how to do just that:

Suppose we have this history:

@paullbyao
paullbyao / gitignore.md
Created Jul 19, 2017 — forked from nepsilon/gitignore.md
Understand what .gitignore rule is ignoring your files — First published in fullweb.io issue #54
View gitignore.md

Understand what .gitignore rule is ignoring your files

Ready to commit, you fire your git status and you don’t see your files 🤔.

Use this command to ask Git what rule is causing this ignore:

$ git check-ignore -v filename

For instance to see what rule ignores tests.pyc:

@paullbyao
paullbyao / Config.php
Created Jul 7, 2017 — forked from colinmollenhour/Config.php
Mage_Core_Model_Config (Magento CE through 1.9 - fixes stampeding)
View Config.php
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
@paullbyao
paullbyao / Config.php
Created Jul 7, 2017 — forked from colinmollenhour/Config.php
Stampede-resistant Config Cache
View Config.php
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
@paullbyao
paullbyao / Config.php
Created Jul 7, 2017 — forked from colinmollenhour/Config.php
Stampede-resistant Config Cache
View Config.php
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
@paullbyao
paullbyao / Update.php
Created Jul 7, 2017 — forked from colinmollenhour/Update.php
Improve Magento Layout Cache Efficiency
View Update.php
<?php
/**
* This rewrite modifies the caching behavior so that the layout cache key references a SHA1
* hash of the layout XML instead of the XML itself to avoid duplication. The layout XML must
* still be generated once for each layout key, but it will not be saved if the identical
* contents already exist, saving considerable cache backend storage.
*/
class Template_Core_Model_Layout_Update extends Mage_Core_Model_Layout_Update
{
@paullbyao
paullbyao / shell_delete_unused_images
Created Jul 7, 2017 — forked from aleron75/shell_delete_unused_images
Delete no more used Product Images on Magento
View shell_delete_unused_images
<?php
require_once 'abstract.php';
class Mage_Shell_CheckImages extends Mage_Shell_Abstract
{
const CATALOG_PRODUCT = '/catalog/product';
const CACHE = '/cache/';
protected function _glob_recursive($pattern, $flags = 0)
You can’t perform that action at this time.