Skip to content

Instantly share code, notes, and snippets.

View treyharris's full-sized avatar

Trey Harris treyharris

View GitHub Profile
local git_email=$(git config --get user.email)
if [[ -z "${git_email}" ]]; then
git config --local user.email [email protected]
fi
@treyharris
treyharris / universal-ctags.org
Last active October 29, 2024 03:00
Installing universal-ctags on Ubuntu so Emacs/Vim can use it

Installing universal-ctags on Ubuntu

This is my preferred way to go about it.

1. Download and build universal-ctags

0: 1 windows (created Mon Jan 7 18:37:13 2019) [211x50]
10: 20 windows (created Mon Jan 7 18:37:43 2019) [211x50] (group 24) (attached)
11: 20 windows (created Mon Jan 7 18:37:45 2019) [211x50] (group 24)
14: 20 windows (created Mon Jan 7 18:37:42 2019) [211x50] (group 24)
16: 20 windows (created Mon Jan 7 18:37:45 2019) [211x50] (group 24)
17: 20 windows (created Mon Jan 7 18:37:46 2019) [211x50] (group 24)
18: 20 windows (created Mon Jan 7 18:37:46 2019) [211x50] (group 24)
19: 20 windows (created Mon Jan 7 18:37:47 2019) [211x50] (group 24)
20: 20 windows (created Mon Jan 7 18:37:47 2019) [211x50] (group 24)
22: 20 windows (created Mon Jan 7 18:37:46 2019) [211x50] (group 24)
We couldn’t find that file to show.
10: 20 windows (created Mon Jan 7 18:37:43 2019) [211x50] (group 24) (attached)
11: 20 windows (created Mon Jan 7 18:37:45 2019) [211x50] (group 24)
14: 20 windows (created Mon Jan 7 18:37:42 2019) [211x50] (group 24)
16: 20 windows (created Mon Jan 7 18:37:45 2019) [211x50] (group 24)
17: 20 windows (created Mon Jan 7 18:37:46 2019) [211x50] (group 24)
18: 20 windows (created Mon Jan 7 18:37:46 2019) [211x50] (group 24)
19: 20 windows (created Mon Jan 7 18:37:47 2019) [211x50] (group 24)
20: 20 windows (created Mon Jan 7 18:37:47 2019) [211x50] (group 24)
22: 20 windows (created Mon Jan 7 18:37:46 2019) [211x50] (group 24)
23: 20 windows (created Mon Jan 7 18:37:47 2019) [211x50] (group 24)
$ tmux list-sessions -F #{session_name}: #{session_group}
10: 24
11: 24
14: 24
16: 24
17: 24
18: 24
19: 24
20: 24
22: 24
$ for p in $protos; do
echo "\nPROTOCOL: $p\n==================="
HUB_PROTOCOL=$p git clone moritz/perl6-all-modules ALL-MODULES
rm -rf ALL-MODULES
──(for)── done
PROTOCOL: https
===================
Cloning into 'ALL-MODULES'...
remote: Enumerating objects: 4803, done.

Odd hub-clone/hub-pull behavior

I first discovered this issue in trying to do a git pull on repo with the origin remote origin git://github.com/moritz/perl6-all-modules.git using hub (which, on my machine, is aliased to git).

After ensuring that I didn't have hub.protocol set in my config files, I first tried modifying the HUB_PROTOCOL variable:

% protos=(https git ssh)
% for p in $protos; do
echo "\nPROTOCOL: $p\n==================="
#!/usr/bin/env python3
from pynput import keyboard
def on_press(key):
try:
print('alphanumeric key {0} pressed'.format(
key.char))
except AttributeError:
print('special key {0} pressed'.format(
key))
@treyharris
treyharris / args.p6
Last active February 28, 2019 23:45
#!/usr/bin/env perl6
use v6.c;
sub next-prime(Int $start = 1 --> Int) {
return ($start..*).grep({ .is-prime }).[1];
}
sub multiple(Int $multiplicand, Int $num = 1 --> Int) {
return $multiplicand * $num;