Skip to content

Instantly share code, notes, and snippets.

View phddoom's full-sized avatar

Mitchell Garvin phddoom

View GitHub Profile
@mendes-davi
mendes-davi / coq_rg.lua
Created February 22, 2022 16:00
ripgrep source for ms-jpq /coq_nvim
-- Original Ideia and Implementation
-- https://github.com/lukas-reineke/cmp-rg
local utils = require("coq_3p.utils")
COQsources = COQsources or {}
COQsources[utils.new_uid(COQsources)] = {
name = "RG",
fn = function(args, callback)
local pattern = "[\\w_-]+"
@vorstrelok
vorstrelok / keepassxc_pam.fish
Created February 2, 2021 15:20
KeePassXC PAM loing manager integration
#!/usr/bin/fish --private
# !!!Security note!!!
# This will give any process running as your user access to your password while
# key has not expired (2 minutes or revocation by service, whatever comes first)
# Proper solution would probably be writing PAM module and transfering key
# straight to KeePassXC's own keyring
set userid (/usr/bin/id -u "$PAM_USER")
if test "$PAM_TYPE" = 'auth'
@wbthomason
wbthomason / help.vim
Last active January 29, 2025 08:43
Neovim: Open help in a floating window
scriptencoding utf-8
" This function originates from https://www.reddit.com/r/neovim/comments/eq1xpt/how_open_help_in_floating_windows/; it isn't mine
function! CreateCenteredFloatingWindow() abort
let width = min([&columns - 4, max([80, &columns - 20])])
let height = min([&lines - 4, max([20, &lines - 10])])
let top = ((&lines - height) / 2) - 1
let left = (&columns - width) / 2
let opts = {'relative': 'editor', 'row': top, 'col': left, 'width': width, 'height': height, 'style': 'minimal'}
@olmokramer
olmokramer / checkbox.vim
Last active April 30, 2021 22:19
Markdown checkbox toggle mappings for Vim
" ~/.vim/autoload/markdown/checkbox.vim
let s:bullet = '^\s*\%(\d\+\.\|[-+*]\)'
function! markdown#checkbox#toggle(...) abort
let c = a:0 ? a:1 : toupper(escape(nr2char(getchar()), '\.*'))
if c !~ '\p'
return
endif
@sainnhe
sainnhe / lightline-and-tmux-config.md
Last active October 23, 2025 04:01
Sexy & Powerful Configuration for Lightline and Tmux

π‘Ίπ’†π’™π’š & π‘·π’π’˜π’†π’“π’‡π’–π’ π‘ͺπ’π’π’‡π’Šπ’ˆπ’–π’“π’‚π’•π’Šπ’π’ 𝒇𝒐𝒓 π‘³π’Šπ’ˆπ’‰π’•π’π’Šπ’π’† 𝒂𝒏𝒅 π‘»π’Žπ’–π’™

Nerd Font

First of all, install a nerd font, and apply it: nerd font

@greigdp
greigdp / xps-9370.md
Created February 3, 2018 22:27
Dell XPS 13 (9370) Archlinux Install Notes

Install Notes - Dell XPS 13 (9370) 2018

The laptop works well on Archlinux. A few notes based on the installation guide for the previous version.

Intel GPU Power Saving

Per the Arch wiki, more power can be saved by creating /etc/modprobe.d/i915.confwith the following content:

options i915 modeset=1 enable_rc6=1 enable_fbc=1 enable_guc_loading=1 enable_guc_submission=1 enable_psr=1
@geosharma
geosharma / aurutils_inst_conf.md
Last active September 10, 2025 02:40
Arch Linux: aurutils installation and configuration

aurutils installation and configuration

This is not a getting started guide, just notes to myself. Due to my limited knowledge there could be mistakes and better ways to do things. I have configured aurutils to the best of my knowledge after reading the manpages and forums. Please refer to aurutils(7) manpages for installation and configuration.

Reference: aurutils(7)

Install aurutils

Install the aurutils using the normal AUR package installation procedure. Until I found aurutils, I used to create a separate directory ~/aur/ for all AUR packages.

@romainl
romainl / vanilla-linter.md
Last active October 18, 2025 20:00
Linting your code, the vanilla way

Linting your code, the vanilla way

You may want a linter plugin to lint your code in Vim but you probably don't need it. At least try the built-in way before jumping on the plugin bandwagon.

Defining makeprg

autocmd FileType <filetype> setlocal makeprg=<external command>

This autocommand tells Vim to use <external command> when invoking :make % in a <filetype> buffer. You can add as many similar lines as needed for other languages.

@t27duck
t27duck / github_unicorn_killer.rb
Created July 3, 2017 18:06
OG unicorn killer script from github
#! /usr/bin/env ruby
unicorn_worker_memory_limit = 460_000
loop do
begin
# unicorn workers
#
# ps output line format:
# 31580 275444 unicorn_rails worker[15] -c /data/github/current/config/unicorn.rb -E production -D