git branch -m old_branch new_branch – переименовать локальную ветку
git push origin :old_branch – удалить старую ветку
git push --set-upstream origin new_branch – выгрузить новую ветку и "закрепить" ее за локальной веткой
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let events = 0; | |
const onClickHandler = event => { | |
events++; | |
setTimeout(() => { | |
if(events === 1){ | |
console.log('click') | |
} else if(events > 1) { | |
console.log('dblclick') | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function extractUrlParams(keys, url) { | |
if (!keys || !keys.length || !Array.isArray(keys)) { | |
throw new Error('Keys would be array of params keys'); | |
} | |
return keys.reduce((agg, key) => { | |
const matches = url.match('[?&]' + key + '=([^&]+)'); | |
agg[key] = matches[1]; | |
return agg; | |
}, {}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object.byString = function(o, s) { | |
s = s.replace(/\[(\w+)\]/g, '.$1'); // convert indexes to properties | |
s = s.replace(/^\./, ''); // strip a leading dot | |
var a = s.split('.'); | |
for (var i = 0, n = a.length; i < n; ++i) { | |
const k = a[i]; | |
if (k in o) { | |
o = o[k]; | |
} else { | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.7' | |
services: | |
postgres: | |
build: ./postgres | |
restart: always | |
environment: | |
POSTGRES_PASSWORD: 12345 | |
volumes: | |
- ./postgres/data:/var/lib/postgresql/data |
Установка PHP:
sudo add-apt-repository -y ppa:ondrej/php
sudo apt update
sudo apt install php7.3
Установка важных расширений необходимых для пакетов Composer:
Go to File -> Settings -> Tools -> Terminal and change Shell path based on the the installed git version.
for 64bit:
"C:\Program Files\Git\bin\sh.exe" --login -i
for 32bit:
"C:\Program Files (x86)\Git\bin\sh.exe" --login -i
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See your sequence name inside psql console with \ds command. | |
ALTER SEQUENCE seq RESTART WITH 1; | |
# Update sequence | |
UPDATE table_name SET id=nextval('seq'); |
/**
* Превращает массив PHP, в массив Postgres
* @param array $pgArray
* @return Expression
*/
static function createPgArray(array $pgArray): Expression
{
$pgArray = json_encode($pgArray, JSON_UNESCAPED_UNICODE);
$pgArray = "'".preg_replace("#^\[(.*)\]$#", '{\1}', $pgArray)."'";
OlderNewer