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
@sashalikesplanes
sashalikesplanes / config.lua
Last active October 24, 2023 15:06
Harpoon X Bufferline Neovim
-- This example shows how to integrate Bufferline with Harpoon
-- The goal is to get bufferline to show only the files marked by harpoon, with the correct number
-- I use <C-w>{1..N} to navigate between the harpoon buffers, my harpoon config is also included
-- I have also setup an autocommand in order to open all the harpoon buffers when launching neovim, it is at the bottom of the file
-- NOTE: this guide relies on you using the lazy package manager
-- bufferline.nvim
-- helper functions:
local function get_marked_buffers()
local mark = require("harpoon.mark")
@Vaisakhkm2625
Vaisakhkm2625 / clipboard.md
Last active December 1, 2023 18:02
clipboard type

Type from clipboard

Windows

$wshell = New-Object -ComObject wscript.shell;$txt='';foreach ($element in $(Get-Clipboard)){$element=$element -replace '[+^%~(){}]','{$0}';$element= -join($element,'{ENTER}');echo $element;$txt = -join($txt,$element);};sleep 4; $wshell.SendKeys($txt);

run this in powershell, and within 4 sec, place cursor at where you want to type all out

@academo
academo / ww
Last active December 26, 2023 10:46
#!/bin/bash
# Usage: ww -f "window class filter" -c "run if not found"
# Usage: ww -fa "window title filter" -c "run if not found"
## Find and contribute to a more updated version https://github.com/academo/ww-run-raise
POSITIONAL=()
while [[ $# -gt 0 ]]; do
key="$1"
@chaorace
chaorace / sn-vimify.user.js
Last active August 21, 2023 17:09
Userscript to enable Vim mode in most ServiceNow script fields. Also dynamically resizes the editor to fit content
// ==UserScript==
// @name SNOW CodeMirror Vim activator & embiggener
// @description Enables vim mode for ServiceNow in most script editor fields. Also englarges the field!
// @namespace https://gist.githubusercontent.com/chaorace/dc49a18f876a9814c8b27d637bfb4f44/raw/sn-vimify.user.js
// @updateURL https://gist.githubusercontent.com/chaorace/dc49a18f876a9814c8b27d637bfb4f44/raw/sn-vimify.user.js
// @supportURL https://gist.github.com/chaorace/dc49a18f876a9814c8b27d637bfb4f44
// @include http://*.service-now.com/*
// @include https://*.service-now.com/*
// @require https://codemirror.net/keymap/vim.js
// @run-at document-idle
@RKursatV
RKursatV / onekoRace.sh
Last active August 5, 2023 19:21
A script generates 100 random oneko characters with random colors and random magnitude of speed
#!/bin/bash
type oneko >/dev/null 2>&1 || { echo >&2 "I require oneko but it's not installed. Aborting."; exit 1; }
array[0]="sakura"
array[1]="tomoyo"
array[2]="neko"
array[3]="dog"
array[4]="tora"
allcolorsS=$(awk -F ' ' '{print $4}' /etc/X11/rgb.txt | tr "\n" " ");
import string
alphabet = string.ascii_lowercase
key1 = '95 83 96 67 56 56 64 92 92 30 85 82 38 81 61 86 48 92 71 79 64 87 87 65 17'
key2 = '76 72 84 63 41 36 45 84 73 18 84 63 30 73 60 77 28 69 66 65 44 62 73 51 12'
print(''.join((map(lambda x: alphabet[int(x[0]) - int(x[1]) - 1], zip(key1.split(' '), key2.split(' '))))))
@liaohuqiu
liaohuqiu / gist:4ee77b9b03afcdecc80252252378d367
Created June 9, 2016 00:38
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;
@zhanglongqi
zhanglongqi / tree_model_pyqt4.py
Last active October 23, 2023 16:40
PyQt tree model
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
longqi 20/Jan/16 22:42
"""
"""
default.txt
"""
"""