Skip to content

Instantly share code, notes, and snippets.

@eserdinyo
eserdinyo / useEmitter.ts
Created November 13, 2023 14:57
Built in eventbus composable for nuxt 3
// composables/useEmitter.ts
export default function () {
const hooks = useNuxtApp().hooks;
return {
emit: hooks.callHook,
on: hooks.hook,
}
}
@alyti
alyti / bookmarklet
Last active April 3, 2024 20:44
Download mods from ageofempires.com
javascript:(function() {
let id = parseInt(location.pathname.match("([0-9]{1,5})")[0], 10); if (id === NaN) {return};
fetch("https://api.ageofempires.com/api/v1/mods/Download", {"credentials": "include", "headers": { "Content-Type": "application/json" }, "body": JSON.stringify({id, boolValue: true}), "method": "POST", "mode": "cors"}).then(r => r.json()).then(r => {location.href = r.value.downloadUrl}).catch(e => console.log(e));
})()