Skip to content

Instantly share code, notes, and snippets.

{"lastUpload":"2021-11-21T19:58:02.114Z","extensionVersion":"v3.4.3"}
@virtueer
virtueer / autoAlias.js
Last active July 24, 2021 17:16
no need to use module-alias, At calling require, it searches directly from the root folder if there is an '@' at the beginning.
const BuiltinModule = require('module');
const path = require('path');
// Guard against poorly mocked module constructors
const Module = module.constructor.length > 1 ? module.constructor : BuiltinModule;
const realResolveFilename = Module._resolveFilename;
Module._resolveFilename = (request, ...args) => {
if (request[0] !== '@') {
return realResolveFilename.call(this, request, ...args);
@virtueer
virtueer / kinds.png
Last active March 14, 2022 09:40
CompletionItemKind Icons
kinds.png
@virtueer
virtueer / gist:4aab76e76082b94f4db96e6e4c248e9e
Created November 7, 2021 11:15
Instagram download image/video
// ctrl + click to video: downloads
// ctrl + click image: opens image in new tab. So the image can be right clicked and downloaded.
// Tested only feed
document.body.onclick = function (event){
if (window.event.ctrlKey) {
if(event.target.ariaLabel !== null)
window.open(event.target.previousElementSibling.previousElementSibling.children[0].children[0].children[0].currentSrc)
else
window.open(event.target.previousElementSibling.children[0].currentSrc)
async function render() {
const loaders = document.querySelectorAll("[xLoad]");
if (loaders.length === 0)
return
for (let i = 0; i < loaders.length; i++) {
const element = loaders[i];
const from = element.getAttribute("xLoad");
const res = await fetch(from);
const list = rawStr.match(/\\u..../g) || []
for (const code of list)
rawStr = rawStr.replace(code, decodeURIComponent(Buffer.from(code.slice(-2), 'hex')))