Skip to content

Instantly share code, notes, and snippets.

View leonardssh's full-sized avatar
:shipit:
<Esc>:wq!<Ret>

Narcis-Ionuț B. leonardssh

:shipit:
<Esc>:wq!<Ret>
View GitHub Profile
@leonardssh
leonardssh / index.vue
Created July 1, 2022 19:54 — forked from yannbcf/index.vue
custom alt:V drag & drop implementation
<script setup lang="ts">
import { InventoryManager } from './inventoryManager';
import { onMounted, onUnmounted } from 'vue';
import { Container } from 'typedi';
onMounted(() => {
const inventoryManager = Container.get(InventoryManager);
const container = document.querySelector('.container');
if (!inventoryManager || !container) return;
@leonardssh
leonardssh / altvHelper.ts
Created May 7, 2022 12:06
Small Vue3 helper for communicating and debugging webviews. Also removes events when unmounted.
import { onUnmounted } from 'vue';
const insideAltV = 'alt' in window;
export function useAltV(removeEventsOnUnmount: boolean = true) {
const eventHandlers: { [eventName: string]: Array<(...args: any[]) => Promise<void> | void> } = {};
const instance = {
insideAltV,
on: (eventName: string, listener: (...args: any[]) => void): void => {
@leonardssh
leonardssh / coc-discord-rpc-wsl-passthrough.md
Created August 22, 2021 19:31 — forked from mousebyte/coc-discord-rpc-wsl-passthrough.md
coc-discord-rpc on WSL: passthrough to Discord on host Windows

Using coc-discord-rpc on WSL

You can use [npiperelay][] to let coc-discord-rpc connect to a Discord instance running on the host Windows operating system. It requires modifying the extension a bit, but it's relatively painless. This guide assumes you have [coc.nvim][] and [coc-discord-rpc][] already installed.

Get npiperelay and socat

To build npiperelay, you'll need [Go][]. Grab the golang package from your favorite package manager and follow the instructions on the [npiperelay][] repo. You'll also need to install socat if it doesn't come with your distribution.