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 myHugeArray = [...Array(10000).keys()].map(id => { return {id}; }); | |
let listIWant = [1010, 2020, 3030, 4040, 5050, 6060, 7070, 8080, 9090]; | |
// INSTEAD OF: | |
myHugeArray.filter(obj => listIWant.includes(obj.id)); | |
// TRY: | |
let mapIWant = new Map(); | |
listIWant.forEach(id => mapIWant.set(id)); | |
myHugeArray.filter(obj => mapIWant.has(obj.id)); |
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 arrayOf100Things = [...Array(100).keys()]; |
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
[ | |
{ | |
"key": "ctrl+tab", | |
"command": "-workbench.action.openNextRecentlyUsedEditorInGroup" | |
}, | |
{ | |
"key": "ctrl+shift+tab", | |
"command": "-workbench.action.openPreviousRecentlyUsedEditorInGroup" | |
}, | |
{ |
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
const emberRunloop = (queue = 'sync') => new Promise(resolve => { | |
scheduleOnce(queue, () => { | |
resolve(); | |
}); | |
}); | |
export default Component.extend({ | |
async _myFunction() { | |
await emberRunloop('afterRender'); | |
// Do your stuff after above specified ember runloop |
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 DirProjectHome = getcwd() | |
function! ExploreToggle(bang) | |
if &ft ==# "netrw" | |
:exe "lcd " . g:DirProjectHome | |
:bd | |
else | |
if a:bang | |
:lcd %:p:h | |
:enew |
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
toWords :: String -> [String] | |
toWords x | |
| length x == 0 = [] | |
| otherwise = takeWhile (/= ' ') x : toWords (drop 1 (dropWhile (/= ' ') x)) |
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
/* | |
* Dracula Theme for Hexo | |
* Borrowed from https://github.com/isagalaev/highlight.js/blob/master/src/styles/dracula.css | |
* Converted to Stylus by SharpShark28 http://github.com/sharpshark28 | |
* Original https://github.com/zenorocha/dracula-theme | |
*/ | |
.highlight | |
.code | |
color: #f8f8f2 |
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 userIsTypingStuff = document.querySelectorAll('input:focus, textarea:focus').length !== 0; |
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
{ | |
"casting_time": "test", | |
"classes": ["sorcerer"], | |
"components": {"raw": "test"}, | |
"description": [ | |
"**Wow!**", | |
"| First Header | Second Header |", | |
"| ------------- | ------------- |", | |
"| Content Cell | Content Cell |", | |
"| Content Cell | Content Cell |" |
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
[ | |
{ | |
"casting_time": "1 segment", | |
"classes": [ | |
"sorcerer", | |
"wizard" | |
], | |
"components": { | |
"raw": "V, S", | |
"material": false, |
NewerOlder