Skip to content

Instantly share code, notes, and snippets.

@tpope
tpope / 90-rodecaster-pro-ii.rules
Created July 6, 2022 20:53
RODECaster Pro II PulseAudio support
# /etc/udev/rules.d/90-rodecaster-pro-ii.rules
# RODECaster Pro II primary USB interface: 19f7:0030
# RODECaster Pro II secondary USB interface: 19f7:0026
# We're only concerned with the former.
# PulseAudio
ATTRS{idVendor}=="19f7", ATTRS{idProduct}=="0030", ENV{PULSE_PROFILE_SET}="rodecaster-pro-ii.conf"
# PipeWire
@tpope
tpope / 20-chrome-suxxx.conf
Created October 19, 2019 22:41
Fix Chrome's chrome using mono-chrome emoji
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="pattern">
<test qual="any" name="family">
<string>Symbola</string>
</test>
<test qual="any" name="prgname" compare="contains">
<string>chrom</string>
</test>
if !has('gui_running')
for s:chr in map(range(char2nr('!'), char2nr('~')), 'nr2char(v:val)')
let s:key = get({'\': 'M-Bslash', '>': 'M-char-62', '[': '', ']': '', 'O': '', 'P': ''}, s:chr, 'M-' . s:chr)
if len(s:key)
exe escape("set <" . s:key . ">=\e" . s:chr, '\|"')
endif
endfor
exe "set <M-Space>=\e\\ "
exe "set <M-CR>=\e\r"
endif
@tpope
tpope / lists.md
Created January 1, 2019 21:11
Markdown list test
  1. one a. A i. one ii. two b. B
  2. two
@tpope
tpope / gtk.css
Last active May 9, 2022 23:42
Alt-X/C/V as cut/copy/paste in GTK apps
/* ~/.config/gtk-3.0/gtk.css */
@import url("file:///usr/share/themes/Emacs/gtk-3.0/gtk-keys.css");
@binding-set gtk-alt-clipboard {
bind "<alt>x" { "cut-clipboard" () };
bind "<alt>c" { "copy-clipboard" () };
bind "<alt>v" { "paste-clipboard" () };
}
ActiveRecord::Base.connection.select_all(scope.arel).tap do |result|
result.map do |attrs|
attrs.each do |k, v|
attrs[k] = result.column_types[k].type_cast(v)
end
end
end 
if !exists('s:path')
if type(get(g:, 'lua_path')) == type([])
let s:path = g:lua_path
else
let s:path = split(system('lua -e "print(package.path)"')[0:-2], ';')
if v:shell_error
let path = []
endif
endif
endif
@tpope
tpope / ctags.sh
Created May 5, 2016 17:48
Ctags git hook
#!/bin/sh
set -e
if [ -d doc -a \( -d autoload -o -d ftdetect -o -d plugin \) ]; then
nohup vim -u NONE -c 'helptags doc' -cq >/dev/null 2>&1 </dev/null &
fi
optfiles=`git ls-files -oc --directory -- .ctags '*/.ctags'`

Keybase proof

I hereby claim:

  • I am tpope on github.
  • I am tpope (https://keybase.io/tpope) on keybase.
  • I have a public key whose fingerprint is 8818 04A5 DA54 1152 FA12 C105 E09E 474A 404A 3A45

To claim this, I am signing this object:

grading_period = @context.courses.map do |course|
GradingPeriod.context_find(course, params[:grading_period_id])
end.compact.first