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
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
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 toggleStates = { | |
| key: 'toggle', | |
| initial: 'inactive', | |
| states: { | |
| inactive: { | |
| on: { | |
| TOGGLE: 'active', | |
| } | |
| }, | |
| active: { |
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
| function Parser(table) { | |
| this.table = table; | |
| } | |
| Parser.prototype.parse = function (input) { | |
| var length = input.length, | |
| table = this.table, | |
| output = [], | |
| stack = [], | |
| index = 0; |
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
| git reflog show --date=local --all | sed 's!^.*refs/!refs/!' | grep '/branch-name' | tail -1 |
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
| let productShowcase = this.initSwiper('.product-showcase', { | |
| slidesPerView: 3, | |
| onInit(e) { | |
| if(e.isBeginning) { | |
| e.prevButton[0].style.display = 'none' | |
| } | |
| }, | |
| }) | |
| productShowcase.forEach((item) => { |
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 isLeapYear = (year) => { | |
| return !(year % 4) && (!!(year % 100) || !(year % 400)) | |
| }, |
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
| function getCurrentTime() { | |
| const date = new Date(); | |
| let h = date.getHours(); | |
| let m = date.getMinutes(); | |
| let s = date.getSeconds(); | |
| h = h < 10 ? `0${h}` : h; | |
| m = m < 10 ? `0${m}` : m; | |
| s = s < 10 ? `0${s}` : s; |
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
| Edit the following files to modify memory and file number limits. These instructions assume Ubuntu 10.04, may work on later versions and other distributions/OSes. (Edit: This works for Ubuntu 14.04 as well.) | |
| /etc/security/limits.conf: | |
| elasticsearch - nofile 65535 | |
| elasticsearch - memlock unlimited | |
| -------------------------------------------------------------------------- | |
| /etc/default/elasticsearch (on CentOS/RH: /etc/sysconfig/elasticsearch ): |
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 phone = "+79009999999" | |
| const formatedPhone = phone.replace(/(\d{1})(\d{3})(\d{3})(\d{2})(\d{2})/, '$1 ($2) $3-$4-$5'); | |
| // -> "+7 (900) 999-99-99" |
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
| computed: { | |
| someComputedProp() { | |
| // You must return function with argument | |
| return (argument) => doStuffWith(argument) | |
| } | |
| } |
NewerOlder