Skip to content

Instantly share code, notes, and snippets.

View hawtim's full-sized avatar
:octocat:

Hawtim hawtim

:octocat:
View GitHub Profile
@hawtim
hawtim / index.vue
Created September 1, 2022 10:16
vue@2 lifecycle hook with async await
<template>
<div>
</div>
</template>
<script>
export default {
beforeCreate() {
console.log('beforeCreate hook done');
},
@hawtim
hawtim / index.js
Created January 6, 2024 07:19
get all external images by matching text content
Array.from(new Set(Array.from(new Set(Array.from(document.getElementsByTagName('*')).filter(item => item.innerText).map(item => item.innerText.includes('https') && item.innerText).filter(Boolean))).map(item => item.match(/https?:\/\/.*(img|image)+.*/gim)).flat(Infinity)))