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
| { | |
| "key": "alt+k", | |
| "command": "selectNextSuggestion", | |
| "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" | |
| }, | |
| { | |
| "key": "alt+j", | |
| "command": "selectPrevSuggestion", | |
| "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" | |
| } |
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
| JsonConvert.SerializeObject( | |
| <YOUR OBJECT>, | |
| new JsonSerializerSettings | |
| { | |
| ContractResolver = new CamelCasePropertyNamesContractResolver() | |
| }); |
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
| var myFun = debounce(() => console.log('call'), 1000); | |
| myFun(); | |
| myFun(); | |
| myFun(); //only this call will be called | |
| function debounce(fn, delay) { | |
| let isActivated = false; | |
| return function() { |
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
| <pre id="log"></pre> | |
| (function(){ | |
| var oldLog = console.log; | |
| console.log = function (message) { | |
| const logger = document.getElementById('log'); | |
| logger.innerHTML += `> ${message}\n`; | |
| oldLog.apply(console, arguments); | |
| }; |
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 sum = 123456.78; | |
| sum.toLocaleString('ru-RU', {style: 'currency', currency: 'RUR'}); | |
| //"123 456,78 RUR" |
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
| #container { | |
| width: 640px; /*can be in percentage also.*/ | |
| margin: 0 auto; | |
| } |
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
| #Sum a list of numbers: | |
| (1..1000).inject { |sum, n| sum + n } | |
| #Sum a list of numbers: | |
| (1..1000).inject(&:+) | |
| #Sum a list of numbers: | |
| (1..1000).inject(:+) | |
| #Filter a list of numbers: | |
| [49, 58, 76, 82, 88, 90].partition { |n| n > 60 } |