f1959eb4c678

Clean up
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 21 Dec 2018 21:50:36 -0500
parents 8324a5a60426
children 46c7c92011de
branches/tags (none)
files bin/conj bin/lilypond bin/longass bin/maven bin/pbpaste bin/quicklisp-update bin/scheme bin/sort-scala-imports fish/config.fish fish/functions/backfor.fish fish/functions/clonedown.fish fish/functions/deact.fish fish/functions/dump.fish fish/functions/edit-pasteboard.fish fish/functions/empty-trash.fish fish/functions/fabric.fish fish/functions/fcowlol.fish fish/functions/fix-open-with.fish fish/functions/fzf-fish.fish fish/functions/gigfor.fish fish/functions/hex.fish fish/functions/hey-virtualbox-shut-down-or-i-will-fucking-cut-you.fish fish/functions/hi.fish fish/functions/isen.fish fish/functions/md.fish fish/functions/oldgcc.fish fish/functions/path_this.fish fish/functions/ppj.fish fish/functions/quietly.fish fish/functions/sc.fish fish/functions/skim.fish fish/functions/spotlight-off.fish fish/functions/spotlight-on.fish fish/functions/spotlight-tail.fish fish/functions/thanks.fish fish/functions/vp.fish fish/functions/wo.fish fish/functions/ydl.fish fish/virtualenv.fish w3m-keymap

Changes

--- a/bin/conj	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-#!/Users/sjl/.virtualenvs/webscraping/bin/python3
-
-import sys
-import requests
-from bs4 import BeautifulSoup
-
-
-en_url = 'http://conjugator.reverso.net/conjugation-english-verb-%s.html'
-is_url = 'http://www.verbix.com/webverbix/go.php?T1=%s&Submit=Go&D1=28&H1=128'
-
-def english(word):
-    resp = requests.get(en_url % word).text
-    soup = BeautifulSoup(resp, "html.parser")
-
-    ws = [t.text.strip()
-          for t in soup.find_all(class_="indicative-wrap")[0]
-                       .div
-                       .find_all("i")[1:]]
-    ws[8] = "y'all"
-
-    # fix third person singular
-    v = ws[5]
-    ws[4:6] = ['he', v, 'she', v, 'it', v]
-
-    # fix third person plural
-    v = ws[15]
-    ws[14:15] = ['they ♂', v, 'they ♀', v, 'they ∅', v]
-    vals = [a + ' ' + b for a, b in zip(ws[::2], ws[1::2])]
-
-    return vals
-
-def icelandic(word):
-    resp = requests.get(is_url % word).text
-    soup = BeautifulSoup(resp, "html.parser")
-
-    ws = [t.text.strip()
-          for t in soup.find_all(class_='pure-u-1-2')[0]
-                       .find_all('span')]
-
-    # fix third person singular
-    v = ws[5]
-    ws[4:6] = ['hann', v, 'hún', v, 'það', v]
-
-    v = ws[15]
-    ws[14:15] = ['þeir', v, 'þær', v, 'þau', v]
-    vals = [a + ' ' + b for a, b in zip(ws[::2], ws[1::2])]
-
-    return vals
-
-eng_word = sys.argv[1]
-ice_word = sys.argv[2]
-
-print('to %s\tað %s' % (eng_word, ice_word))
-
-eng = english(eng_word)
-ice = icelandic(ice_word)
-
-for e, i in zip(eng, ice):
-    print('%s\t%s' % (e, i))
-
-print('to %s / að %s\t' % (eng_word, ice_word), end='')
-print('<table>', end='')
-for e, i in zip(eng, ice):
-    e1, e2 = e.rsplit(' ', 1)
-    i1, i2 = i.split(' ')
-
-    print('<tr>', end='')
-    print('<td>%s</td><td>%s</td><td>%s</td><td><b>%s</b></td>' % (e1, e2, i1, i2), end='')
-    print('</tr>', end='')
-print('</table>')
--- a/bin/lilypond	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-#!/bin/bash
-exec /Applications/LilyPond.app/Contents/Resources/bin/lilypond "$@"
--- a/bin/longass	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-
-if len(sys.argv) > 1:
-    n = int(sys.argv[1]) - 1
-else:
-    n = 20
-
-print r'''
-_______
-   \   \
-    \   \
-''',
-print '     |   |\n' * n,
-print r'''     |   |
-    /   /
-___/___/
-'''
-
--- a/bin/maven	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-mvn "$@" | grep --line-buffered -Ev 'Including.*in the shaded jar' | grcat ~/.grc/conf.maven
--- a/bin/pbpaste	Fri Dec 21 18:52:47 2018 -0500
+++ b/bin/pbpaste	Fri Dec 21 21:50:36 2018 -0500
@@ -1,2 +1,3 @@
 #!/usr/bin/env bash
+
 xclip -selection clipboard -o
--- a/bin/quicklisp-update	Fri Dec 21 18:52:47 2018 -0500
+++ b/bin/quicklisp-update	Fri Dec 21 21:50:36 2018 -0500
@@ -1,3 +1,3 @@
 #!/usr/bin/env bash
 
-sbcl --eval '(ql:update-client)' --eval '(ql:update-all-dists)' --eval '(quit)'
+sbcl --eval '(ql:update-client)' --eval '(ql:update-all-dists)' --quit
--- a/bin/scheme	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-rlwrap mit-scheme "$@"
--- a/bin/sort-scala-imports	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-#!/usr/bin/env python
-
-import re, sys
-from operator import attrgetter
-
-
-bracket_padding = None
-MAX_LINE_WIDTH = 100
-
-def next_line():
-    return sys.stdin.readline().rstrip('\n')
-
-l = next_line()
-
-while not l.startswith('import '):
-    sys.stdout.write(l + '\n')
-    l = next_line()
-
-class ImportGroup(object):
-    def __init__(self, line):
-        self.main_line = line.rstrip()
-        self.prefix = None
-        self.guts = []
-
-    def set_line(self):
-        """Set the main_line and guts for the given prefix and guts.
-
-        If the import will fit into 100 chars, the short group syntax will be
-        used.  Otherwise the longer one will be used.
-
-        """
-        prefix = self.prefix
-        guts = self.guts
-        guts.sort(key=lambda s: s.lower())
-
-        if not prefix:
-            # This is just a single-line, single-item import, so we don't need
-            # to do any setup.
-            return
-
-        single = '%s{%s%s%s}' % (prefix,
-                                 bracket_padding,
-                                 ', '.join(guts),
-                                 bracket_padding)
-        if len(single) > MAX_LINE_WIDTH:
-            self.main_line = prefix + '{'
-            self.guts = guts
-        else:
-            self.main_line = single
-            self.guts = []
-
-    def slurp(self):
-        global l, bracket_padding
-
-        line = self.main_line
-        if self.main_line.endswith('}'):
-            # This is a line like: import foo.{ a, b, c }
-            if bracket_padding is None:
-                if line[line.index("{") + 1] == " ":
-                    bracket_padding = " "
-                else:
-                    bracket_padding = ""
-
-            prefix, rest = line.split('{', 1)
-
-            guts = re.findall(r"\w+ *=> *\w+|\w+", rest)
-
-            self.prefix = prefix
-            self.guts = guts
-
-            l = next_line()
-        elif line.endswith('{'):
-            # This is the first line of a multi-line set
-            prefix = line.rstrip('{')
-            guts = []
-            while True:
-                l = next_line()
-                if l.rstrip().endswith('}'):
-                    l = next_line()
-                    break
-                else:
-                    guts.append(l.strip().rstrip(','))
-
-            self.prefix = prefix
-            self.guts = guts
-        else:
-            # Just a normal single import line, pass it on.
-            l = next_line()
-
-    def spit(self):
-        self.set_line()
-
-        sys.stdout.write(self.main_line + '\n')
-
-        if self.guts:
-            self.guts.sort(key=lambda g: g.lower())
-            sys.stdout.write('  ' +
-                             ',\n  '.join(self.guts) +
-                             '\n}\n')
-
-    def key(self):
-        return self.main_line.lower().replace('{', '@')
-
-imports = []
-while l.startswith('import '):
-    ig = ImportGroup(l)
-    ig.slurp()
-    imports.append(ig)
-
-if bracket_padding is None:
-    bracket_padding = " "
-
-imports.sort(key=lambda ig: ig.key())
-
-for i in imports:
-    i.spit()
-
-sys.stdout.write(l + '\n')
-
-for l in sys.stdin.readlines():
-    sys.stdout.write(l)
-
--- a/fish/config.fish	Fri Dec 21 18:52:47 2018 -0500
+++ b/fish/config.fish	Fri Dec 21 21:50:36 2018 -0500
@@ -102,9 +102,6 @@
 # Python {{{
 
 set -g -x PIP_DOWNLOAD_CACHE "$HOME/.pip/cache"
-set -g -x WORKON_HOME "$HOME/lib/virtualenvs"
-# eval (/usr/bin/python -m virtualfish)
-
 set -g -x PYTHONPATH ""
 set PYTHONPATH "$HOME/lib/hg/hg:$PYTHONPATH"
 
--- a/fish/functions/backfor.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function backfor
-    cp ~/Dropbox/tasks/backpack-archive ~/Dropbox/tasks/backpack.txt
-end
--- a/fish/functions/clonedown.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-function clonedown -d "clone a repo down"
-    cd ~/src
-    git clone $argv
-    cd (echo "$argv" | sed -Ee 's_.*/__')
-end
--- a/fish/functions/deact.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function deact -d "deactivate"
-    deactivate
-end
--- a/fish/functions/dump.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-function dump -d "dump to/from the internet"
-    hg -R ~/.plan push
-    hg -R ~/.plan push git
-
-    hg -R ~/src/cl-nrepl push
-
-    hg -R ~/src/ru push
-
-    hg -R ~/src/temperance push
-    hg -R ~/src/temperance push git
-
-    hg -R ~/src/scully push
-    hg -R ~/src/scully push git
-
-    hg -R ~/src/mazes push
-    hg -R ~/src/mazes push git
-
-    hg -R ~/src/cl-ggp push
-    hg -R ~/src/cl-ggp push git
-
-    hg -R ~/src/sand push
-    hg -R ~/src/sand push git
-
-    hg -R ~/src/hype push
-    hg -R ~/src/hype push git
-
-    hg -R ~/src/cl-losh push
-    hg -R ~/src/cl-losh push git
-
-    hg -R ~/src/beast push
-    hg -R ~/src/beast push git
-
-    hg -R ~/src/vex push
-    hg -R ~/src/vex push git
-
-    hg -R ~/src/cl-digraph push
-    hg -R ~/src/cl-digraph push git
-
-    hg -R ~/src/magitek push
-    hg -R ~/src/magitek push git
-
-    hg -R ~/src/chancery push
-    hg -R ~/src/chancery push git
-
-    hg -R ~/src/dotfiles push
-
-    offlineimap -qf INBOX
-end
--- a/fish/functions/edit-pasteboard.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function edit-pasteboard
-    pbpaste | vipe | pbcopy
-end
--- a/fish/functions/empty-trash.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-function emptytrash -d "Empty the OS X trash folders"
-    sudo rm -rfv /Volumes/*/.Trashes
-    sudo rm -rfv ~/.Trash
-    sudo rm -rfv /private/var/log/asl/*.asl
-end
--- a/fish/functions/fabric.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function fabric -d "fab with my SSH identity"
-    fab -i ~/.ssh/stevelosh $argv
-end
--- a/fish/functions/fcowlol.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function fcowlol -d "Show a fun twitch banner" --wraps "figlet"
-    figlet -f ogre -w9999 $argv | cowsay -W 9999 -n -p | lolcat
-end
--- a/fish/functions/fix-open-with.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-function fix-open-with -d "Fix the shitty OS X Open With menu duplicates"
-    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user
-    killall Finder
-    echo "Open With has been rebuilt, Finder will relaunch"
-end
-
-
--- a/fish/functions/fzf-fish.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-function fzf-fish
-  set -q FZF_FIND_FILE_COMMAND
-  or set -l FZF_FIND_FILE_COMMAND "ffind --semi-restricted --depth=15 --follow"
-  fish -c "$FZF_FIND_FILE_COMMAND" | fzf -m --height 15 | read -l selects
-  and commandline -i "\"$selects\""
-  commandline -f repaint
-end
-
-# https://github.com/fisherman/fzf/blob/master/key_bindings.fish
--- a/fish/functions/gigfor.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function gigfor
-    cp ~/Dropbox/tasks/gig-archive ~/Dropbox/tasks/gig.txt
-end
--- a/fish/functions/hex.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function hex -d "Open a file in Hex Fiend"
-    open -a Hex\ Fiend $argv
-end
--- a/fish/functions/hey-virtualbox-shut-down-or-i-will-fucking-cut-you.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-function hey-virtualbox-shut-down-or-i-will-fucking-cut-you
-    VBoxManage controlvm $argv poweroff
-end
-
--- a/fish/functions/hi.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-function hi --argument pattern -d "Highlight a pattern in a stream of text"
-    grep -E --color=always --line-buffered "$pattern|\$"
-end
-
--- a/fish/functions/isen.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function isen -d "Translate from Icelandic to English" --wraps "trans"
-    trans -b -u firefox is:en $argv
-end
--- a/fish/functions/md.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function md -d "mkdir" --wrap "mkdir"
-    mkdir -p $argv
-end
--- a/fish/functions/oldgcc.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function oldgcc -d "Set \$CC to the old GCC"
-    set -g CC /usr/bin/gcc-4.0
-end
--- a/fish/functions/path_this.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function path_this -d "Add the cwd to the front of PATH"
-    set PATH (pwd) $PATH
-end
--- a/fish/functions/ppj.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function ppj -d "Prettify Pasteboard JSON"
-    pbp | pj
-end
--- a/fish/functions/quietly.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function quietly -d "Run a command and hide the output"
-    eval $argv >/dev/null ^/dev/null
-end
--- a/fish/functions/sc.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function sc -d "Launch a Scala console"
-    mvn scala:console $argv
-end
--- a/fish/functions/skim.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function skim -d "Open file in Skim.app"
-    open -a Skim $argv
-end
--- a/fish/functions/spotlight-off.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-function spotlight-off -d "Turn off Spotlight indexing"
-    sudo mdutil -a -i off
-    and sudo mv /System/Library/CoreServices/Search.bundle/ /System/Library/CoreServices/SearchOff.bundle/
-    and killall SystemUIServer
-end
--- a/fish/functions/spotlight-on.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-function spotlight-on -d "Turn on Spotlight indexing"
-    sudo mdutil -a -i on
-    and sudo mv /System/Library/CoreServices/SearchOff.bundle/ /System/Library/CoreServices/Search.bundle/
-    and killall SystemUIServer
-end
--- a/fish/functions/spotlight-tail.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function spotlight-tail -d "Watch what Spotlight is doing"
-    sudo fs_usage -w -f filesys mdworker | grep "open"
-end
--- a/fish/functions/thanks.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function thanks
-    clear; and fcowlol 'Thanks!'
-end
--- a/fish/functions/vp.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function vp -d "Vim Pasteboard"
-  pbpaste | vim -
-end
--- a/fish/functions/wo.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function wo -d "workon"
-    workon $argv
-end
--- a/fish/functions/ydl.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function ydl -d "Youtube-DL" --wraps "youtube-dl"
-    youtube-dl $argv
-end
--- a/fish/virtualenv.fish	Fri Dec 21 18:52:47 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-# mostly from http://coderseye.com/2010/using-virtualenv-with-fish-shell.html
-
-function workon -d "Activate virtual environment in $WORKON_HOME"
-  set tgt {$WORKON_HOME}/$argv[1]
-
-  if [ ! -d $tgt ]
-    mkdir -p "$WORKON_HOME"
-    virtualenv $tgt
-  end
-
-  if [ -d $tgt ]
-    cd $tgt
-
-    deactivate
-
-    set -gx VIRTUAL_ENV "$tgt"
-    set -gx _OLD_VIRTUAL_PATH $PATH
-    set -gx PATH "$VIRTUAL_ENV/bin" $PATH
-
-    # unset PYTHONHOME if set
-    if set -q PYTHONHOME
-       set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
-       set -e PYTHONHOME
-    end
-
-    cd -
-    echo "activated $tgt"
-  else
-    echo "$tgt not found"
-  end
-end
-
-complete -c workon -a "(cd $WORKON_HOME; ls -d *)"
-
-function deactivate -d "Exit virtualenv and return to normal shell environment"
-    # reset old environment variables
-    if test -n "$_OLD_VIRTUAL_PATH"
-        set -gx PATH $_OLD_VIRTUAL_PATH
-        set -e _OLD_VIRTUAL_PATH
-    end
-    if test -n "$_OLD_VIRTUAL_PYTHONHOME"
-        set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
-        set -e _OLD_VIRTUAL_PYTHONHOME
-    end
-    set -e VIRTUAL_ENV
-end
-
--- a/w3m-keymap	Fri Dec 21 18:52:47 2018 -0500
+++ b/w3m-keymap	Fri Dec 21 21:50:36 2018 -0500
@@ -1,2 +1,4 @@
 keymap  q       EXIT
 keymap  K       EXIT
+keymap  H       PREV_PAGE
+keymap  L       NEXT_PAGE