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
[ 42.25, 42.5, 42.75 ].map(parseInt) // Cuidado! Isso retorna [42, NaN, NaN] e não [ 42, 42, 42 ] |
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
parseInt('42px') // Isso retorna 42 | |
Math.floor('42px') // Isso retorna NaN :'-( |
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 splitWith3 = val => { | |
return val | |
.split(/(\d{3})/g) | |
.filter(Boolean) | |
} | |
const split = num => { | |
switch (num.length % 3) { | |
case 2: | |
return [ |
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
javascript:void(window.prompt('', `[${document.title.replace(/\s-\s\w+$/, '')}](${location.href})`)) |
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
// ==UserScript== | |
// @name Buscar na Wikipédia | |
// @namespace bw | |
// @version 2 | |
// @description Pressione a seta da direita para focar na barra de pesquisa da Wikipédia. | |
// @author Matheus Alves | |
// @match https://*.wikipedia.org/* | |
// ==/UserScript== | |
(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
<!DOCTYPE NETSCAPE-Bookmark-file-1> | |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> | |
<TITLE>Bookmarks</TITLE> | |
<H1>Bookmarks</H1> | |
<DL><p> | |
<DT><H3 PERSONAL_TOOLBAR_FOLDER="true">Velocidade</H3> | |
<DL><p> | |
<DT><A HREF="javascript:document.querySelector('video').playbackRate = 0.25">0.25x</A> | |
<DT><A HREF="javascript:document.querySelector('video').playbackRate = 0.5">0.50x</A> | |
<DT><A HREF="javascript:document.querySelector('video').playbackRate = 0.75">0.75x</A> |
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
alert( | |
( | |
Array.from( | |
ytInitialData | |
.contents | |
.twoColumnWatchNextResults | |
.playlist | |
.playlist | |
.contents | |
) |
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
// total("07:30") === 7.5 | |
const total = t => | |
t | |
.split(":") | |
.map(Number) | |
.map((n, i) => !i ? n : n / 60) | |
.reduce((c, p) => c + p); |
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
copy(Array.from(ytInitialData.contents.twoColumnWatchNextResults.playlist.playlist.contents).map(content => (content.playlistPanelVideoRenderer.title||{}).simpleText).filter(Boolean).join("\n")) |
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
console.log(Array.from(document.querySelectorAll(".style-scope.ytd-playlist-panel-video-renderer span")).map(el => el.title.trim()).filter(Boolean).join("\n")) |