Skip to content

Instantly share code, notes, and snippets.

Tim Pope tpope

Block or report user

Report or block tpope

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View meta.vim
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 Jan 1, 2019
Markdown list test
View lists.md
  1. one a. A i. one ii. two b. B
  2. two
@tpope
tpope / gtk.css
Last active Dec 19, 2017
Alt-X/C/V as cut/copy/paste in GTK apps
View gtk.css
/* ~/.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" () };
}
View data_from_scope.rb
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 
View lua_tpope.vim
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
Ctags git hook
View ctags.sh
#!/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'`
View keybase.md

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:

View find_first_or_nil.rb
grading_period = @context.courses.map do |course|
GradingPeriod.context_find(course, params[:grading_period_id])
end.compact.first
@tpope
tpope / find_first_or_nil.rb
Last active Sep 14, 2015 — forked from strand/find_first_or_nil.rb
A way to fing the first thing that matches or set to nil
View find_first_or_nil.rb
grading_period = @context.courses.detect do |course|
gp = GradingPeriod.context_find(course, params[:grading_period_id]) and break gp
end
@tpope
tpope / git-ssh
Created May 9, 2015
SSH to Git remotes
View git-ssh
#!/usr/bin/env bash
# SSH to the user and host given by a Git remote and chdir to the repo path.
# The first argument is the remote name. All other arguments are passed to
# SSH, with some fudging to run a login shell if no command is given.
# Use git ssh -d to see the exact SSH command.
# Copyright (c) Tim Pope. Distributed under the MIT License.
You can’t perform that action at this time.