This file contains hidden or 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
// clear docker volumes and start with clean page | |
docker-compose down | |
docker rm -f $(docker ps -a -q) | |
docker volume rm $(docker volume ls -q) | |
docker-compose up -d |
This file contains hidden or 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
export const leftTrim = (string) => { | |
if (!string) return string; | |
return string.replace(/^\s+/g, ''); | |
} | |
export const rightTrim = (string) => { | |
if (!string) return string; | |
return str.replace(/\s+$/g, ''); | |
} |
This file contains hidden or 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
{ | |
"USD": { | |
"symbol": "$", | |
"name": "US Dollar", | |
"symbol_native": "$", | |
"decimal_digits": 2, | |
"rounding": 0, | |
"code": "USD", | |
"name_plural": "US dollars" | |
}, |
This file contains hidden or 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
const pattern = /^\d{0,4}(\.\d{0,4})?$/; | |
console.log('@@@MATCH', pattern.test(text)); |
This file contains hidden or 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
'use strict'; | |
module.exports = { | |
up: (queryInterface, Sequelize) => { | |
return queryInterface.changeColumn( | |
'table', | |
'column', | |
{ | |
type: Sequelize.TEXT, | |
} |
This file contains hidden or 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
const getInitialModalState = () => ({ | |
projects: {}, | |
modalCreate: false, | |
modalAskForDelete: false, | |
currentId: 0, | |
currentDescription: '', | |
currentStart: defaultDate, | |
currentEnd: defaultDate, | |
currentDate: defaultDate, | |
currentTitle: 'Добавить переработку', |
This file contains hidden or 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
//custom textInput filter. | |
function setInputFilter(textbox, inputFilter) { | |
["input", "keydown", "keyup", "mousedown", "mouseup", "select", "contextmenu", "drop"].forEach(function (event) { | |
textbox.addEventListener(event, function () { | |
if (inputFilter(this.value)) { | |
this.oldValue = this.value; | |
this.oldSelectionStart = this.selectionStart; | |
this.oldSelectionEnd = this.selectionEnd; |
This file contains hidden or 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
const logRequestStart = (req, res, next) => { | |
console.log('\x1b[33m%s\x1b[0m', `${req.method} ${req.originalUrl}`) | |
res.on('finish', () => { | |
console.log(`${res.statusCode} ${res.statusMessage}; ${res.get('Content-Length') || 0}b sent`) | |
}) | |
next() | |
} |
This file contains hidden or 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
document.removeEventListener("keydown", this.handleEscapeButton, false); | |
handleEscapeButton = (event) => { | |
if (event.keyCode === 27) { | |
this.setState({ openFilter: false }); | |
} | |
}; |
NewerOlder