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 obj = { | |
values: [1, 2, 3, 4, 5], | |
[Symbol.iterator]() { | |
let i = 0 | |
return { | |
next: () => { | |
i++ | |
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
const multilineString = ` | |
This is... | |
a multiline string. | |
` | |
const minify = it => it.replace(/\s+/g, '') | |
minify(multilineString) | |
// Thisis...amultilinestring. |
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 toCamelCase = (str, separator) => | |
separator | |
? str.toLowerCase().replace( | |
new RegExp(`(${separator})*(${separator}.{1})`, 'g'), | |
char => char.toUpperCase().substr(1) | |
) | |
: str | |
console.log( | |
toCamelCase('my-cool-function', '-') // myCoolFunction |
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 prepareModuleForInjection = code => { | |
const moduleBody = /(?<=\{return\s).*(?=})|(?<=({(?![return]))).*(?=})|(?<=\=>\s)(?=[a-z]).*|(?<=\=>)\n.*/gsi | |
const [extractedBody] = String(code).match(moduleBody) || '' | |
return extractedBody | |
? `${extractedBody.trim()}\n\n` | |
: '' | |
} | |
webview.executeJavaScript( |
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 tableProps = { | |
postId: ['varchar', 'NOT NULL', 'PRIMARY KEY'], | |
id: ['numeric', 'NOT NULL', 'PRIMARY KEY'], | |
data: ['json', 'NOT NULL'] | |
} | |
const result = | |
Object | |
.keys(tableProps) | |
.reduce((acc, key) => { |
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 getTrace = error => error.stack.match(/(?<=\().*(?=\))/g) |
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
var style = document.createElement('style') | |
style.textContent = ` | |
html, body { display: contents; } | |
html, body, img, time, div[role=button] canvas, .coreSpriteDropdownArrowGrey9, button .glyphsSpriteHeart__outline__24__grey_9, .glyphsSpriteComment__outline__24__grey_9, .glyphsSpriteShare__outline__24__grey_9, .glyphsSpriteSave__outline__24__grey_9, video { filter: invert(1); } | |
.glyphsSpriteComment_like, .glyphsSpriteMore_horizontal__outline__24__grey_9 { filter: invert(1) !important; color: white !important; } | |
li div span span, main div button { filter: invert(1) !important; color: white !important; } | |
li div span span a { color: #77b3d8 !important; } | |
label { filter: invert(1) !important; } | |
header button img, button span img, button div canvas { filter: invert(0) !important; } | |
time { color: #77b3d8 !important; } |
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
{ | |
"settings": "{\n \"workbench.startupEditor\": \"newUntitledFile\",\n \"workbench.colorTheme\": \"One Monokai 80s\",\n \"editor.tabSize\": 2,\n \"terminal.external.linuxExec\": \"zsh\",\n \"terminal.integrated.shell.osx\": \"/bin/zsh\",\n \"editor.minimap.enabled\": false,\n \"window.zoomLevel\": 0,\n \"javascript.updateImportsOnFileMove.enabled\": \"always\",\n \"editor.wordWrap\": \"on\",\n \"breadcrumbs.enabled\": false,\n \"editor.overviewRulerBorder\": false\n}\n", | |
"keybindings": "// Place your key bindings in this file to overwrite the defaultsauto[]\n[\n {\n \"key\": \"f5\",\n \"command\": \"workbench.action.debug.continue\",\n \"when\": \"inDebugMode\"\n },\n {\n \"key\": \"f5\",\n \"command\": \"-workbench.action.debug.continue\",\n \"when\": \"inDebugMode\"\n }\n]", | |
"snippets": [ | |
{ | |
"dalton.code-snippets": "{\n\t\"Print to console\": {\n\t\t\"scope\": \"javascript,typescript\",\n\t\t\"prefix\": \"log\",\n\t\t\"body\": [\n\t\t\t\" |
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 removeAccent = s => s.normalize('NFD').replace(/[\u0300-\u036f]/g, '') |
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
list = '' | |
document.querySelectorAll('.video-preload-title-label').forEach(name => list += `${name.textContent} \n`) | |
copy(list) | |
console.log(list) |