Skip to content

Instantly share code, notes, and snippets.

View manan-gup's full-sized avatar

Manan Gupta manan-gup

  • New Delhi
View GitHub Profile
@Lamarcke
Lamarcke / lualine.lua
Last active March 16, 2024 22:50
Lualine config for LSP clients, formatters and linters
-- Returns a string with a list of attached LSP clients, including
-- formatters and linters from null-ls, nvim-lint and formatter.nvim
local function get_attached_clients()
local buf_clients = vim.lsp.get_active_clients({ bufnr = 0 })
if #buf_clients == 0 then
return "LSP Inactive"
end
local buf_ft = vim.bo.filetype
@nat-418
nat-418 / nix-home-manager-neovim-setup.md
Last active May 25, 2024 19:42
Manage Neovim plugins (and more!) with Nix and Home Manager

Manage Neovim plugins (and more!) with Nix and Home Manager

Highly extensible software like Emacs, Vim, and Neovim tend to grow their own package managers. A software developer, for example, might want to install editor plugins that hook into a particular programming language's linter or language server. The programmer's text editor is therefore extended to support managing additional software to extend the text editor. If this loop continues for too long, the programmer's editor becomes more delicate and complex. The remedy for this problem is to manage software using dedicated tools apart

@raulchiclano
raulchiclano / README.md
Created September 23, 2022 11:24 — forked from matthewpi/README.md
Nix on Fedora

NixOS on Fedora

Please note that these instructions are not offically supported or condoned by Nix and are not guaranteed to always work, but from my testing everything seems to work perfectly fine.

These steps may not be required if NixOS/nix#2374 is resolved.

SELinux

These commands are required for both Fedora Workstation and Fedora Silverblue

using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@myyc
myyc / arch_linux_install_guide.md
Last active May 30, 2024 23:58
Arch Linux setup with all the good stuff (Plymouth, encryption, systemd-boot etc.)

Hope this will stay relevant for longer than just 2021. This guide will focus mostly on things you shouldn't overlook and will harshly prioritise assuming that you're running on recent hardware. EFI and all that.

Always refer to the official guide in case of doubt.

First things first

One important thing first: the environment you will encounter on the live image is very different from what you'll end up installing, some things are significantly easier there: e.g. wifi tools come pre-installed, the default shell is a pimped zsh with nice completions, and so on. We'll keep this

@jeb5
jeb5 / Youtube Subs to OPML.js
Last active April 16, 2024 18:30
Youtube Subscriptions to RSS/OPML
const channels = [...document.querySelectorAll("#main-link.channel-link")].map(e => {
const [, a, b] = e.href.match("/((?:user)|(?:channel))/(.*)$");
const feed = "https://www.youtube.com/feeds/videos.xml?" + (a === "user" ? "user=" : "channel_id=") + b;
const channelName = e.querySelector("yt-formatted-string.ytd-channel-name").innerText;
return [feed, channelName];
});
if (channels.length == 0) {
alert("Couldn't find any subscriptions");
} else {
console.log(channels.map(([feed, _]) => feed).join("\n"));
@bitingsock
bitingsock / ytdl-preload.lua
Last active May 30, 2024 19:47
Precache the next entry in your playlist if it is a network source by downloading it to a temp file ahead of time. Change Line 20 to temp directory. It will delete the directory on exit.
----------------------
-- #example ytdl_preload.conf
-- # make sure lines do not have trailing whitespace
-- # ytdl_opt has no sanity check and should be formatted exactly how it would appear in yt-dlp CLI, they are split into a key/value pair on whitespace
-- # at least on Windows, do not escape '\' in temp, just us a single one for each divider
-- #temp=R:\ytdltest
-- #ytdl_opt1=-r 50k
-- #ytdl_opt2=-N 5
-- #ytdl_opt#=etc
@kppullin
kppullin / config.fish
Created May 16, 2020 03:51
Fish shell + WSL2 + gnome-keyring / secret-tool
#
# This fish config sets up a working `gnome-keyring` on WSL2.
# I imagine it will work with WSL1 as well, perhaps after adjusting the `DISPLAY` value.
#
# Based off this bash script: https://askubuntu.com/questions/815327/running-gnome-keyring-on-wsl-windows-subsystem-for-linux
# Tested and working with `aws-vault` and `jetbrains-toolbox`.
#
# Be sure your x server is running!!!
set -x DISPLAY (cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
@SpaghettiBorgar
SpaghettiBorgar / mpv-clip.lua
Created April 5, 2020 18:42
mpv script to quickly create gifs, video clips, and sound clips
-- Create animated GIFs with mpv
-- Requires ffmpeg, gifski, exiftool, and vorbis-tools.
-- Based on github.com/Scheliux/mpv-gif-generator
-- Usage: "g" to set start frame, "G" to set end frame,
-- "Ctrl+g" to create gif
-- "Ctrl+v" to create video clip
-- "Ctrl+a" to create audio clip
-- Metadata about the filename and timestamps will be written in the comment tag
local msg = require 'mp.msg'