Skip to content

Instantly share code, notes, and snippets.

View matheusolivesilva's full-sized avatar
🏠
Working from home

Matheus Oliveira da Silva matheusolivesilva

🏠
Working from home
View GitHub Profile
@matheusolivesilva
matheusolivesilva / read-youtube-elapsed-time.js
Created September 9, 2023 03:03
Snippet that reads elapsed time in watched videos in a Youtube playlist
const whatchedVideos = []
document.querySelectorAll('.style-scope.ytd-playlist-video-renderer').forEach(video => {
const progress = video.querySelector('.style-scope.ytd-thumbnail-overlay-resume-playback-renderer')
const title = video.querySelector('a#video-title')
const duration = video.querySelector('#text')
if(progress === null) return
@matheusolivesilva
matheusolivesilva / read-netflix-elapsed-time.js
Last active September 9, 2023 03:03
Snippet that reads Netflix elapsed time in a season
let totalInMinutes = 0
document.querySelectorAll('.episodeSelector-container span.duration.ellipsized').forEach(duration => {
const durationInMinutes = Number(duration.textContent.replace(/m|h/g, ''));
totalInMinutes += durationInMinutes
})
const minutesInOneHour = 60
const hours = Math.trunc(totalInMinutes / minutesInOneHour)
@matheusolivesilva
matheusolivesilva / README.md
Created October 9, 2021 01:26 — forked from argentinaluiz/README.md
VSCode - Guia para configuração do ambiente com Docker
<script>
var whatsappButton = document.querySelectorAll('.redes-sociais i.fab.fa-whatsapp');
whatsappButton.forEach(function(whats) {
whats.addEventListener('click', function() {
fbq('track', 'Contact');
});
});
</script>
<script>
var wpcf7Elm = document.querySelectorAll('.wpcf7');
wpcf7Elm.forEach(function(form) {
form.addEventListener('wpcf7mailsent', function(event) {
fbq('track', 'Lead');
}, false);
});
</script>
@matheusolivesilva
matheusolivesilva / DefaultController.php
Created October 31, 2020 19:10 — forked from webdevilopers/DefaultController.php
Sending JWT Token in Guzzle POST with LexikJWTAuthenticationBundle
<?php
namespace AppBundle\Controller;
class DefaultController extends Controller
{
/**
* @Route("/gettoken")
*/
public function getToken()
@matheusolivesilva
matheusolivesilva / History\-141c4a0f\entries.json
Last active September 15, 2022 20:15 — forked from PurpleBooth/README-Template.md
A template to make good README.md
{"version":1,"resource":"file:///home/matheus/Desktop/nest-todo-app/todo-app-frontend/src/components/Input/index.tsx","entries":[{"id":"yRNW.tsx","timestamp":1655266675769},{"id":"Hskk.tsx","source":"moved.source","timestamp":1655266768187}]}