Skip to content

Instantly share code, notes, and snippets.

View Vaisakhkm2625's full-sized avatar

Vaisakh K M Vaisakhkm2625

  • <-- you don't need to know :)
View GitHub Profile

make qr code for selected text

let selection = window.getSelection().toString();
let encodedSelection = encodeURIComponent(selection)

let popupContent = `<html lang="en">
<head>
 
@Vaisakhkm2625
Vaisakhkm2625 / snippetmanagers.md
Created February 22, 2024 10:06
cli snippet managers
@Vaisakhkm2625
Vaisakhkm2625 / gist:ba1ff2503f1b2748a010f42837675d7f
Last active October 20, 2023 20:51
host sveltekit in github pages
```
npm i -D @sveltejs/adapter-static
```
```
echo "export const prerender = true;" >> ./src/routes/+layout.js
```
change
```
@Vaisakhkm2625
Vaisakhkm2625 / pythondevenv.md
Last active October 12, 2023 18:29
Nix dev environment python

Using pip and virtualenv

mkdir projectname
cd projectname

initating the template

nix flake init --template github:the-nix-way/dev-template#python # this should be in bash
@Vaisakhkm2625
Vaisakhkm2625 / docker.md
Created June 20, 2023 11:53
docker - my notes

docker build -t dockerfile . docker run --expose 5000 -p 5000:5000 dockerfile

docker ps
docker exec -it <container_name> bash
@Vaisakhkm2625
Vaisakhkm2625 / vimlatexrederingplugins.md
Last active June 15, 2023 23:07
VIM Latex redering plugins
@Vaisakhkm2625
Vaisakhkm2625 / settingupnewholograminlazyvim.md
Last active May 26, 2023 22:19
How to set up hologram plugin in lazyvim

setting up hologram plugin in lazyvim (vhyrro's branch, not merged)

add hologram plugin

~/.config/nvim/lua/plugins/hologram.lua

return {
{
 "vhyrro/hologram.nvim",
 config = function()
@Vaisakhkm2625
Vaisakhkm2625 / greengrass.md
Created April 17, 2023 18:44
touching green grass

https://youtu.be/cShoIaGjvwc

This is a tutorial on how to touch grass

but they forgot to tell how to make grass green... that is here

LS_COLORS="*grass=01;32:$LS_COLORS"

@Vaisakhkm2625
Vaisakhkm2625 / surfingkeys.js
Last active May 13, 2023 11:27
surfingkeys config
//surfingkeys config
// an example to create a new mapping `ctrl-y`
api.mapkey('<ctrl-y>', 'Show me the money', function() {
Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).');
});
// simulate vimium's behaviour of using HLJK
api.map('H','S'); // History back
api.map('L','D'); // History back
@Vaisakhkm2625
Vaisakhkm2625 / gist:c991b1490a20099125ec4b5660b125c3
Created March 8, 2023 12:15 — forked from liaohuqiu/gist:4ee77b9b03afcdecc80252252378d367
Find out the full duration time of a YouTube playlist
var list = document.getElementsByClassName('pl-video-time');
var time = 0;
function toS(hms) {
var a = hms.split(':');
while (a.length < 3) {
a.unshift(0);
}
var seconds = (+a[0]) * 60 * 60 + (+a[1]) * 60 + (+a[2]);
return seconds;