Skip to content

Instantly share code, notes, and snippets.

@6ui11em
6ui11em / gitignore.txt
Last active August 27, 2019 07:46
Wordpress gitigonore #wordpress #git #gitignore
# ignore everything in the root except the "wp-content" directory.
!wp-content/
# ignore everything in the "wp-content" directory, except:
# "mu-plugins", "plugins", "themes" directory
wp-content/*
!wp-content/mu-plugins/
!wp-content/plugins/
!wp-content/themes/
@6ui11em
6ui11em / hover.css
Created May 16, 2019 15:59
CSS: Hover fade transition #css #fade #hover
a {
transition: color 0.3s ease-in-out;
}
@6ui11em
6ui11em / coreConfigData_InstallData.php
Created May 14, 2019 08:48
Magento 2: installData core_config_data #magento2, #installdata, #config
<?php
/**
* InstallData
*
* @copyright Copyright © 2019 The Etailers. All rights reserved.
* @author [email protected]
*/
namespace FERR\AlternateHreflang\Setup;
@6ui11em
6ui11em / layout_text_block.xml
Created May 8, 2019 09:25
Magento 2: Layout Text Block #magento2, #layout, #block, #text
<block class="Magento\Framework\View\Element\Text" name="excl.tax.label">
<action method="setText">
<argument translate="true" name="text" xsi:type="string">Excl. Tax</argument>
</action>
</block>
@6ui11em
6ui11em / lsit-files.sh
Created March 8, 2019 00:17
List recursive all files in directory order by mod date #unix #command #list
find -printf "%TY-%Tm-%Td %TT %p\n" | sort -n
@6ui11em
6ui11em / merge_arrays.js
Created January 11, 2019 09:05
Javascript merge arrays #javascript #js #array #merge
var sandwiches1 = ['turkey', 'tuna', 'blt'];
var sandwiches2 = ['chicken', 'pb&j', 'tuna'];
var allSandwiches = sandwiches1.concat(sandwiches2);
// sandwiches1: ['turkey', 'tuna', 'blt']
// sandwiches2: ['chicken', 'pb&j', 'tuna']
// allSandwiches: ['turkey', 'tuna', 'blt', 'chicken', 'pb&j', 'tuna']
@6ui11em
6ui11em / remove_array_duplicates.js
Created January 11, 2019 09:04
Javascript remove array duplicates #javascript #js #array #duplicates
var sandwiches = ['turkey', 'ham', 'turkey', 'tuna', 'pb&j', 'ham', 'turkey', 'tuna'];
var deduped = sandwiches.filter(function (sandwich, index) {
return sandwiches.indexOf(sandwich) === index;
});
// Logs ["turkey", "ham", "tuna", "pb&j"]
console.log(deduped);
@6ui11em
6ui11em / magento2_get_config_value.php
Created October 31, 2018 14:53
Magento 2 get config value #magento2 #config #core_config
/* Constructor */
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
$this->scopeConfig = $scopeConfig
/* Use */
$this->scopeConfig->getValue('dev/debug/template_hints', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
@6ui11em
6ui11em / change_git_commit_message.sh
Created October 26, 2018 21:10
Git change last commit message #git #command #message
git commit --amend
@6ui11em
6ui11em / delete-tag.sh
Last active June 9, 2021 13:48
Git delete / update remote tag #git #tag #tagname #delete #modify #update
#Delete remote tag
git push --delete origin <tag>
#Move tag
git tag --force v1.0 <ID-of-commit-127>
git push --force --tags