Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / 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 / gitinit.sh
Created August 27, 2019 06:58
Git code to repository #git
git init
git add .
git commit -m "initial commit of full repository"
git remote add origin <bitbucket_URL>
git push -u origin --all
@6ui11em
6ui11em / docker.sh
Last active October 6, 2019 22:32
Docker useful commands #docker #commands #unix
# List all containers
$ docker ps -a
# List started containers
$ docker ps
# List stopped containers
docker ps --filter "status=exited"
# Stop container
@6ui11em
6ui11em / composer.sh
Last active October 17, 2019 09:47
Composer: useful commands #composer #commands
# run composer to avoid memory limit error
php -d memory_limit=-1 /usr/local/bin/composer …
# ignore requirements
composer ... --ignore-platform-reqs
@6ui11em
6ui11em / touch-media-quieries.css
Created May 5, 2020 14:10
CSS: Tocuh screen media quieris #css #media-query #responsive
/* smartphones, touchscreens */
@media (hover: none) and (pointer: coarse) {
/* ... */
}
/* stylus-based screens */
@media (hover: none) and (pointer: fine) {
/* ... */
}
/* Nintendo Wii controller, Microsoft Kinect */
@media (hover: hover) and (pointer: coarse) {