Skip to content

Instantly share code, notes, and snippets.

@rommmka
rommmka / gist:8145158
Created December 27, 2013 10:31
Regexp URL
<?php
$pattern = '/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/i'
?>
@rommmka
rommmka / .sh
Created July 13, 2016 12:05
Exclude files with rights changes from commit
git -c core.filemode=false diff
@rommmka
rommmka / ips
Last active July 14, 2021 11:55
* 194.44.93.57 [UA-Work]
* 77.123.3.82 [UA-Home]
* 77.123.41.41 [Home-computer]
Create a symlink for each project to your home directory. Say your project is located at `~/projects/foo` and you want to have it located at /var/www/foo, run:
```bash
sudo ln -sT ~/www/magento2 /var/www/html/magento2
```
If your home directory has no execute bit (descend) set for other (for security reasons), change the group of it to www-data, but set the execute bit only (no read/write). Do the same for the ~/projects folder as it may contain other projects than www. (You don't need sudo if you have previously added your user to the www-data group.)
```bash
sudo chgrp www-data ~ ~/www
#### 1. `console.group(‘name’)` and `console.groupEnd(‘name’)`
As the name suggests it will group multiple logs in one single expandable group, you can even nest them if you’d like to further group them. `console.group(‘groupName’)` starts the group and `console.groupEnd(‘groupName’)` closes a group. There is a third function `console.groupCollapsed` which creates the group in collapsed mode.
#### 2. `console.trace()`
When you need to find the whole call stack of a function, console.trace is super useful, I use this mostly to find from where callback is passed, it will print the whole stack-trace. Let’s take an example:
```js
function foo() {
function bar() {
diff --git a/lib/internal/Magento/Framework/Logger/Handler/System.php b/lib/internal/Magento/Framework/Logger/Handler/System.php
index b30195e9797..b7647b5beb9 100644
--- a/lib/internal/Magento/Framework/Logger/Handler/System.php
+++ b/lib/internal/Magento/Framework/Logger/Handler/System.php
@@ -19,7 +19,7 @@ class System extends Base
/**
* @var int
*/
- protected $loggerType = Logger::INFO;
+ protected $loggerType = Logger::WARNING;
Please, run following CLI command (fill with your data):
---
composer config -a --file="var/composer_home/auth.json" http-basic.ci.swissuplabs.com "DOMAIN" "IDENTITY_KEY"
---

catalog/Adminhtml_category

html, body {
position:relative;
overflow-x:hidden;
}
curl -sS https://getcomposer.org/installer | php