Skip to content

Instantly share code, notes, and snippets.

View Makaze's full-sized avatar
🕳️
Learning Neovim 🖋️

Christopher Lane Makaze

🕳️
Learning Neovim 🖋️
View GitHub Profile
@Makaze
Makaze / gruvbox_custom.vim
Created April 29, 2024 19:38
My customized gruvbox theme
hi SpecialKey guifg=#484442
hi link EndOfBuffer NonText
hi TermCursor cterm=reverse gui=reverse
hi clear TermCursorNC
hi NonText guifg=#484442
hi Directory guifg=#83a598
hi ErrorMsg guifg=#fb4934 guibg=#282828
hi IncSearch guifg=#3c3836 guibg=#fe8019
hi Search guifg=#3c3836 guibg=#fabd2f
hi CurSearch ctermfg=0 ctermbg=11 guifg=NvimDarkGrey1 guibg=NvimLightYellow
@Makaze
Makaze / caps2esc_install_ubuntu.sh
Last active April 13, 2024 15:40
caps2esc on Ubuntu 22.04 -- Remap capslock to esc and ctrl
# Install interception tools and caps2esc
### Install requirements
sudo apt update && sudo apt upgrade
sudo apt install cmake libevdev-dev libudev-dev libyaml-cpp-dev libboost-dev
sudo apt install git
sudo apt install debianutils
sudo apt install pkg-config
sudo apt install clang
### Install interception and caps2esc
@Makaze
Makaze / misc.txt
Created March 31, 2024 06:01
Misc images
A collection of miscellaneous images in the comments to use in READMEs.
@Makaze
Makaze / watch.lua
Created March 26, 2024 16:55
Continually replace buffer contents with a command. A scrollable alternative to the linux `watch` command
local M = {}
local A = vim.api
M.buf = nil
-- Replace buffer's contents with a command and preserve the cursor
M.update = function(command)
return function()
-- Save current cursor position
local saveCursor = A.nvim_win_get_cursor(0)
@Makaze
Makaze / AdjustIndent.vim
Created March 25, 2024 01:23
Match the indent level of the previous line in normal mode, or enforce the most common indent level on all lines in a visual selection
function! Mode(values)
let frequency = {}
for value in a:values
if !has_key(frequency, value)
let frequency[value] = 0
endif
let frequency[value] += 1
endfor
let max_frequency = 0
let mode_value = 0
@Makaze
Makaze / ExportHighlights.vim
Last active March 24, 2024 21:11
Export the current highlights as a file in vim / neovim to be :source 'd later
function ExportHighlights(file)
try
let lines = execute('hi')
let lines = substitute(lines, '\v(^|\n)+', '\1hi ', 'g')
let lines = substitute(lines, 'xxx ', '', 'g')
let lines = substitute(lines, '\v(\S+) +links to +(\S+)', 'link \1 \2', 'g')
let lines = substitute(lines, '\v(\S+) +cleared', 'clear \1', 'g')
let lines = split(lines, "\n")
call writefile(lines, a:file, 'b')
echo "Highlights exported to " . a:file

What are the parts of an SQL statement?

First, the simplest select statement possible is:

SELECT 'Hi!'

This will print out the value 'Hi!'. The select statement simply prints out whatever it is told. You can also query from a database:

SELECT 'Hi, ', name FROM users
@Makaze
Makaze / Instructions.md
Created February 24, 2024 19:33 — forked from vn-ki/Instructions.md
Use ranger as chrome file chooser

Use ranger as chrome file chooser

  1. Copy the contents of kdialog to /usr/local/bin/kdialog
  2. Copy the contents of chrome_chooser.py to ~/.config/ranger/plugins/chrome_chooser.py
  3. Optionally map appropriately
  4. Run chrome with XDG_CURRENT_DESKTOP=KDE
@Makaze
Makaze / docs.python.org.user.css
Last active December 22, 2023 17:25
Makes the python docs just a little easier to read.
/* Makes the python docs just a little easier to read. */
/* ==UserStyle==
@name docs.python.org - Dec 2023
@namespace github.com/openstyles/stylus
@version 1.0.0
@description Python Docs style
@author Makaze
==/UserStyle== */
@-moz-document domain("docs.python.org") {
h1,
@Makaze
Makaze / Boards-ie_Mafia_Votal_Generator.user.js
Last active November 26, 2019 17:03
A mafia vote counter for Boards.ie forum.
// ==UserScript==
// @name Boars.ie - Mafia Votal Generator
// @namespace Makaze
// @description A feature-rich votal generator generator for Boards.ie mafia.
// @include *://www.boards.ie/vbulletin/showthread.php*
// @grant none
// @version 1.0.0
// ==/UserScript==
function createElement(type, callback) {