Skip to content

Instantly share code, notes, and snippets.

View craigmac's full-sized avatar
🥋
Elbows up.

C.D. MacEachern craigmac

🥋
Elbows up.
View GitHub Profile
@romainl
romainl / dotctags.md
Last active April 5, 2022 18:45
Extending Exuberant Ctags

Extending Exuberant Ctags

Configuration

Like most CLI programs, Ctags can have its behaviour changed by passing it options like -R, to make it work recursively, or -f badaboom, to make it generate a file called badaboom.

Teaching Ctags about a new language or extending the rules of a supported language is also done with options like --langmap or --regex-<lang>. For example, we could call Ctags with these options:

$ ctags -R --regex-javascript=<regex> --regex-javascript=<regex> [...] --regex-javascript=<regex> .
@mjlbach
mjlbach / effective_questions.md
Last active September 17, 2022 18:30
Asking effective questions

Foreword

The open source community depends on the efforts of a small group of volunteers relative to the number of users. In order to make the most of contributors' time, here is some advice for asking “good questions”. This is largely paraphrased from this article by Eric Steven Raymond and Rick Moen, with edits for brevity and tone. If you have the time (and tolerance), I strongly recommend reading that article over this one. Let's start with the procedure.

The procedure

  1. Try to find an answer by searching the archives of the issue-tracker, IRC, matrix-room, discord, forum or mailing list you plan to post to.
  2. Try to find an answer by searching the Web.
  3. Try to find an answer by reading the manual.
  4. Try to find an answer by reading a FAQ.
  5. Try to find an answer by inspection or experimentation.
@craigmac
craigmac / average_dark.lua
Created April 25, 2023 01:24 — forked from echasnovski/average_dark.lua
Experiment with computing "average popular Neovim color scheme"
-- Made with 'mini.colors' module of https://github.com/echasnovski/mini.nvim
if vim.g.colors_name ~= nil then vim.cmd('highlight clear') end
vim.g.colors_name = "average_dark"
-- Highlight groups
local hi = vim.api.nvim_set_hl
hi(0, "@constant.builtin", { ctermfg = 146, fg = "#8ebbd3" })
hi(0, "@constructor", { ctermfg = 110, fg = "#7fbce4" })
@echasnovski
echasnovski / average_dark.lua
Created April 24, 2023 13:32
Experiment with computing "average popular Neovim color scheme"
-- Made with 'mini.colors' module of https://github.com/echasnovski/mini.nvim
if vim.g.colors_name ~= nil then vim.cmd('highlight clear') end
vim.g.colors_name = "average_dark"
-- Highlight groups
local hi = vim.api.nvim_set_hl
hi(0, "@constant.builtin", { ctermfg = 146, fg = "#8ebbd3" })
hi(0, "@constructor", { ctermfg = 110, fg = "#7fbce4" })
@rafaponieman
rafaponieman / rename_app.py
Created December 6, 2017 00:21
Django rename app management command
import argparse
from django.core.management.base import BaseCommand
from django.db import connection
class Command(BaseCommand):
help = 'Renames app. Usage rename_app [old_name] [new_name] [classes ...]'
def add_arguments(self, parser):
@blaix
blaix / whatversionoftmuxamirunning.txt
Created August 18, 2017 17:44
I just wanted to know what version of tmux I'm running...
$ tmux --version
tmux: illegal option -- -
usage: tmux [-2CluvV] [-c shell-command] [-f file] [-L socket-name]
[-S socket-path] [command [flags]]
$ tmux --help
tmux: illegal option -- -
usage: tmux [-2CluvV] [-c shell-command] [-f file] [-L socket-name]
[-S socket-path] [command [flags]]
@jfcherng
jfcherng / st4-changelog.md
Last active August 18, 2024 07:25
Sublime Text 4 changelog just because it's not on the official website yet.
@romainl
romainl / eslint-standard.md
Last active November 9, 2024 20:55
Painless ESLint/Standard integration

Painless ESLint/Standard integration

Our goal, here, is threefold:

  • use Vim's built-in features to their fullest,
  • be a good project citizen even if we don't use $EDITOR_DU_JOUR,
  • have a minimal but beneficial impact on the infrastructure of the project we work on.

Expose a simple interface for linting at the project level

@romainl
romainl / _rnb.md
Last active November 24, 2024 19:50
RNB, a Vim colorscheme template
@romainl
romainl / redir.md
Last active January 2, 2025 00:36
Redirect the output of a Vim or external command into a scratch buffer

Redirect the output of a Vim or external command into a scratch buffer

Usage (any shell)

Show full output of command :hi in scratch window:

:Redir hi

Show full output of command :!ls -al in scratch window: