Skip to content

Instantly share code, notes, and snippets.

@walish
walish / docker.md
Last active June 2, 2020 08:01
Learn Docker

DOCKER

  • List container: docker container ls -a
  • Remove container: docker container rm container_id
  • Remove all stopped container: docker container prune
  • List docker image: docker image ls
  • Remove image: docker image rm image_id
  • Remove unused image: docker image prune
  • List volume: docker volume ls
  • Remove volume: docker volume rm volume_id
  • Remove unused volume: docker volume prune
@walish
walish / magento.conf
Created August 16, 2019 09:28
Apache2 configuration file
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerName magento.local
DocumentRoot /var/www/html/magento/pub
<Directory /var/www/html/magento/pub>
SSLOptions +StdEnvVars
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
@walish
walish / xampp_php7_xdebug.md
Created May 11, 2019 04:58 — forked from odan/xampp_php7_xdebug.md
Installing Xdebug for XAMPP

Installing Xdebug for XAMPP with PHP 7.x

Requirements

Setup

Magento 2: Multiple websites or stores (Apache/Nginx)

Assumptions

  • You have two websites other than the default:
    • us.mysite.com with website code us and store view code us
    • german.mysite.com with website code german and store view code de
    • mysite.com is the default website and default store view
@walish
walish / regex-101.md
Last active July 16, 2018 08:14
Encountered Regular Expression Cases
  • Replace wrappers around strings Find string
<\?= __\('(.*)?'\) \?>  // <?= __('必須') ?>

Substitution

<!-- ko i18n: '$1'--><!-- /ko --> //<!-- ko i18n: '必須'--><!-- /ko -->
  • Trim unicode/UTF-8 whitespace in PHP
@walish
walish / JapaneseRegex.js
Created June 19, 2018 09:24 — forked from ryanmcgrath/JapaneseRegex.js
Regex to test for presence of Japanese characters
// REFERENCE UNICODE TABLES:
// http://www.rikai.com/library/kanjitables/kanji_codes.unicode.shtml
// http://www.tamasoft.co.jp/en/general-info/unicode.html
//
// TEST EDITOR:
// http://www.gethifi.com/tools/regex
//
// UNICODE RANGE : DESCRIPTION
//
// 3000-303F : punctuation
#!/bin/sh
# Update
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install software-properties-common
sudo apt-get install python3-software-properties
# Git
sudo apt-get install git git-core -y
@walish
walish / xdebug-php.md
Last active July 16, 2018 06:49 — forked from ankurk91/xdebug-mac.md
php xDebug on Ubuntu/Mac and phpStorm 2017

🪲 Install and Configure xDebug on Ubuntu/Mac and PhpStorm 🐘

  • Assuming that you have already installed php and apache
  • Install xDebug php extension
# Ubuntu 18.04, 16.04, php 7.0
sudo apt install php-xdebug

# Ubuntu 14.04, php 5.6 
sudo apt-get install php5-xdebug
@walish
walish / php_multiple_versions.md
Created January 17, 2018 11:04 — forked from dhduc/php_multiple_versions.md
Use multiple PHP versions

Use multiple PHP versions

You can use multiple PHP versions with one Apache server. Easily install them via the Apt package manager by the famous PPA from Ondrej. Then you can install multiple PHP versions like so:

sudo apt install php7.1 php5.6 php7.0

For being able to switch the PHP versions within the Apache webserver, you need the Lib Apache packages. You can install them like so:

[core]
excludesfile = ~/.gitignore
# excludesfile = ~/.gitignore_global
pager = less -FRSX
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
editor = nano
mergeoptions = --no-commit --no-ff
[mergetool]
keepBackup = true
[difftool "sourcetree"]