remove unused dotfiles

This commit is contained in:
Noah Masur 2020-11-24 22:52:56 -05:00
parent 1f66344d55
commit ae03d21fea
21 changed files with 0 additions and 1146 deletions

View File

@ -1,16 +0,0 @@
#!/usr/bin/env bash
function export-emacs {
if [ "$(emacsclient -e t)" != 't' ]; then
return 1
fi
for name in "${@}"; do
value=$(eval echo \"\$${name}\")
emacsclient -e "(setenv \"${name}\" \"${value}\")" >/dev/null
done
}
for i in $(python -c $"import os; [print(k) for k in os.environ.keys()]"); do
export-emacs "$i"
done

View File

@ -1,3 +0,0 @@
#!/usr/bin/env ruby
system %{osascript -e 'display notification "#{ARGV.join(' ')}"'}

View File

@ -1,3 +0,0 @@
#!/usr/bin/env bash
python -c $"import os; [print(k) for k in os.environ.keys()]" > ~/Document/GitHub/dotfiles/env.txt

View File

@ -1,22 +0,0 @@
#!/usr/bin/env ruby
require "digest"
def compute_sha
contents = Dir["./**/*.rs"].map do |file|
File.read(file)
end.join("\n")
Digest::MD5.hexdigest(contents)
end
sha = compute_sha
loop do
new_sha = compute_sha
if sha != new_sha
sha = new_sha
system "clear && echo '#{'-'*80}' && cargo test"
end
sleep 1
end

View File

@ -1,25 +0,0 @@
#!/usr/bin/env ruby
require "uri"
module Clipboard
class << self
def paste
`pbpaste`.chomp
end
end
end
def parse_params(url)
url.query.split("&").each_with_object({}) do |param, acc|
key, value = *param.split("=", 2)
acc[key] = value
end
end
url = URI.parse Clipboard.paste
params = parse_params url
id = params.fetch("v") { raise "Probably not a youtube URL" }
clean_url = "https://www.youtube.com/watch?v=#{id}"
system "(cd ~/Downloads && youtube-dl -f best \"#{clean_url}\")"

View File

@ -1,8 +0,0 @@
boto3==1.10.49
botocore==1.13.49
docutils==0.15.2
jmespath==0.9.4
python-dateutil==2.8.1
s3transfer==0.2.1
six==1.13.0
urllib3==1.25.7

View File

@ -104,6 +104,5 @@ echo ""
echo "consider running other scripts:"
echo " - install_casks"
echo " - configure_macos"
echo " - install_python"
echo " - install_rust"
echo ""

View File

@ -1,53 +0,0 @@
#!/bin/sh
PYTHON_VERSION=3.8.2
DOTS=$(dirname "$0")/..
cd "$DOTS" || (echo "Directory not found: $DOTS"; exit 1)
DOTS="$PWD"
check_for_pyenv() {
if ! (which pyenv > /dev/null)
then
echo ""
echo "pyenv not found"
if ! (/usr/local/bin/brew list | grep pyenv > /dev/null)
then
echo "pyenv not installed, run: bootstrap"
echo ""
else
echo "pyenv is installed, run: setup_symlinks (and restart)"
echo ""
fi
exit 1
fi
echo "pyenv ✓"
}
setup_python() {
/usr/local/bin/pyenv install $PYTHON_VERSION --skip-existing
/usr/local/bin/pyenv global $PYTHON_VERSION
echo "python $PYTHON_VERSION ✓"
}
setup_python_envs() {
for dir in "$DOTS"/python/*/
do
dir=${dir%*/}
envname=$(basename "$dir")
if ! (/usr/local/bin/pyenv versions | grep -w "$envname" > /dev/null)
then
/usr/local/bin/pyenv virtualenv "$PYTHON_VERSION" "$envname" > /dev/null
fi
# shellcheck source=/dev/null
. "$HOME/.pyenv/versions/$envname/bin/activate"
pip install --upgrade pip > /dev/null
pip install -r "$dir/requirements.txt" > /dev/null
deactivate
echo " - venv: $envname ✓"
done
}
check_for_pyenv
setup_python
setup_python_envs

View File

@ -1,40 +0,0 @@
#!/bin/sh
setup_keybase() {
KEYBASE_USER=$(keybase whoami || (echo "Please login to keybase first"; exit 1))
keybase fs sync enable "/keybase/private/$KEYBASE_USER"
echo "keybase ✓"
}
backup_keybase_ssh() {
SSH_DIR="/Volumes/Keybase/private/$KEYBASE_USER/ssh"
if [ -d "$SSH_DIR" ]
then
rsync -a ~/.ssh/ "$SSH_DIR"/
echo " - backed up to keybase: ssh ✓"
else
echo "Directory not found: $SSH_DIR"
echo "Please check your keybase files"
exit 1
fi
}
backup_keybase_aws() {
AWS_DIR="/Volumes/Keybase/private/$KEYBASE_USER/aws"
if [ -d "$AWS_DIR" ]
then
rsync -a ~/.aws/ "$AWS_DIR"/
echo " - backed up to keybase: aws ✓"
else
echo "Directory not found: $AWS_DIR"
echo "Please check your keybase files"
exit 1
fi
}
setup_keybase
backup_keybase_ssh
backup_keybase_aws

View File

@ -1,14 +0,0 @@
#!/bin/sh
install_ohmyzsh() {
if [ ! -d ~/.oh-my-zsh ]
then
printf "\ninstalling oh my zsh...\nremember to restart terminal afterwards\n\n"
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
echo ""
fi
echo "installed ✓"
}
install_ohmyzsh

View File

@ -1,40 +0,0 @@
#!/bin/sh
setup_keybase() {
KEYBASE_USER=$(keybase whoami || (echo "Please login to keybase first"; exit 1))
keybase fs sync enable "/keybase/private/$KEYBASE_USER"
echo "keybase ✓"
}
setup_keybase_ssh() {
SSH_DIR="/Volumes/Keybase/private/$KEYBASE_USER/ssh"
if [ -d "$SSH_DIR" ]
then
rsync -a "$SSH_DIR"/ ~/.ssh/
echo " - keybase: ssh ✓"
else
echo "Directory not found: $SSH_DIR"
echo "Please check your keybase files"
exit 1
fi
}
setup_keybase_aws() {
AWS_DIR="/Volumes/Keybase/private/$KEYBASE_USER/aws"
if [ -d "$AWS_DIR" ]
then
rsync -a "$AWS_DIR"/ ~/.aws/
echo " - keybase: aws ✓"
else
echo "Directory not found: $AWS_DIR"
echo "Please check your keybase files"
exit 1
fi
}
setup_keybase
setup_keybase_ssh
setup_keybase_aws

View File

@ -1,40 +0,0 @@
#!/bin/sh
check_for_zsh() {
if ! (echo "$SHELL" | grep zsh > /dev/null)
then
echo "Switch to using zsh before continuing"
echo ""
echo "MacOS Instructions:"
echo "System Preferences > Users & Groups > Unlock"
echo "Right-click on user, Advanced Options..."
echo "Login shell: /bin/zsh"
exit 1
fi
echo "zsh ✓"
}
check_for_ohmyzsh() {
if [ ! -d ~/.oh-my-zsh ]
then
echo "oh-my-zsh ✕"
echo ""
echo "Install oh-my-zsh before continuing"
echo "You can run the script: install_ohmyzsh"
echo ""
exit 1
fi
echo "oh-my-zsh ✓"
}
install_spacemacs() {
emacsdir=~/.emacs.d
if ! (git -C "$emacsdir" pull > /dev/null 2>&1)
then
git clone -b develop https://github.com/syl20bnr/spacemacs "$emacsdir"
fi
echo "spacemacs ✓"
}

View File

@ -1,461 +0,0 @@
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'
;; or `spacemacs'. (default 'spacemacs)
dotspacemacs-distribution 'spacemacs
;; Lazy installation of layers (i.e. layers are installed only when a file
;; with a supported type is opened). Possible values are `all', `unused'
;; and `nil'. `unused' will lazy install only unused layers (i.e. layers
;; not listed in variable `dotspacemacs-configuration-layers'), `all' will
;; lazy install any layer that support lazy installation even the layers
;; listed in `dotspacemacs-configuration-layers'. `nil' disable the lazy
;; installation feature and you have to explicitly list a layer in the
;; variable `dotspacemacs-configuration-layers' to install it.
;; (default 'unused)
dotspacemacs-enable-lazy-installation 'unused
;; If non-nil then Spacemacs will ask for confirmation before installing
;; a layer lazily. (default t)
dotspacemacs-ask-for-lazy-installation t
;; If non-nil layers with lazy install support are lazy installed.
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (i.e. `~/.mycontribs/')
dotspacemacs-configuration-layer-path '()
;; List of configuration layers to load.
dotspacemacs-configuration-layers
'(go
ruby
vimscript
php
sql
sml
javascript
html
csv
(rust :variables
rust-format-on-save t)
(lsp :variables
lsp-ui-doc-enable nil
lsp-ui-sideline-code-actions-prefix ""
lsp-ui-sideline-show-hover nil
lsp-rust-server 'rust-analyzer
lsp-rust-analyzer-server-display-inlay-hints t
lsp-rust-analyzer-cargo-watch-enable t)
python
;; javascript
helm
(auto-completion :variables
auto-completion-return-key-behavior nil
auto-completion-tab-key-behavior 'complete
auto-completion-enable-sort-by-usage t
auto-completion-private-snippets-directory nil)
;; better-defaults
emacs-lisp
git
markdown
org
osx
ranger
dash
yaml
terraform
docker
nginx
restclient
games
xkcd
;; (shell :variables
;; shell-default-height 30
;; shell-default-position 'bottom)
;; spell-checking
;; syntax-checking
(syntax-checking :variables
syntax-checking-enable-tooltips nil)
;; version-control
)
;; List of additional packages that will be installed without being
;; wrapped in a layer. If you need some configuration for these
;; packages, then consider creating a layer. You can also put the
;; configuration in `dotspacemacs/user-config'.
dotspacemacs-additional-packages '(dockerfile-mode)
;; A list of packages that cannot be updated.
dotspacemacs-frozen-packages '()
;; A list of packages that will not be installed and loaded.
dotspacemacs-excluded-packages '()
;; Defines the behaviour of Spacemacs when installing packages.
;; Possible values are `used-only', `used-but-keep-unused' and `all'.
;; `used-only' installs only explicitly used packages and uninstall any
;; unused packages as well as their unused dependencies.
;; `used-but-keep-unused' installs only the used packages but won't uninstall
;; them if they become unused. `all' installs *all* packages supported by
;; Spacemacs and never uninstall them. (default is `used-only')
dotspacemacs-install-packages 'used-only))
(defun dotspacemacs/init ()
"Initialization function.
This function is called at the very startup of Spacemacs initialization
before layers configuration.
You should not put any user code in there besides modifying the variable
values."
;; This setq-default sexp is an exhaustive list of all the supported
;; spacemacs settings.
(setq-default
;; If non nil ELPA repositories are contacted via HTTPS whenever it's
;; possible. Set it to nil if you have no way to use HTTPS in your
;; environment, otherwise it is strongly recommended to let it set to t.
;; This variable has no effect if Emacs is launched with the parameter
;; `--insecure' which forces the value of this variable to nil.
;; (default t)
dotspacemacs-elpa-https t
;; Maximum allowed time in seconds to contact an ELPA repository.
dotspacemacs-elpa-timeout 5
;; If non nil then spacemacs will check for updates at startup
;; when the current branch is not `develop'. Note that checking for
;; new versions works via git commands, thus it calls GitHub services
;; whenever you start Emacs. (default nil)
dotspacemacs-check-for-update nil
;; If non-nil, a form that evaluates to a package directory. For example, to
;; use different package directories for different Emacs versions, set this
;; to `emacs-version'.
dotspacemacs-elpa-subdirectory nil
;; One of `vim', `emacs' or `hybrid'.
;; `hybrid' is like `vim' except that `insert state' is replaced by the
;; `hybrid state' with `emacs' key bindings. The value can also be a list
;; with `:variables' keyword (similar to layers). Check the editing styles
;; section of the documentation for details on available variables.
;; (default 'vim)
dotspacemacs-editing-style 'vim
;; NO IDEA WHAT THIS IS
dotspacemacs-mode-line-theme 'spacemacs
;; If non nil output loading progress in `*Messages*' buffer. (default nil)
dotspacemacs-verbose-loading nil
;; Specify the startup banner. Default value is `official', it displays
;; the official spacemacs logo. An integer value is the index of text
;; banner, `random' chooses a random text banner in `core/banners'
;; directory. A string value must be a path to an image format supported
;; by your Emacs build.
;; If the value is nil then no banner is displayed. (default 'official)
dotspacemacs-startup-banner 'official
;; List of items to show in startup buffer or an association list of
;; the form `(list-type . list-size)`. If nil then it is disabled.
;; Possible values for list-type are:
;; `recents' `bookmarks' `projects' `agenda' `todos'."
;; List sizes may be nil, in which case
;; `spacemacs-buffer-startup-lists-length' takes effect.
dotspacemacs-startup-lists '((recents . 5)
(projects . 7))
;; True if the home buffer should respond to resize events.
dotspacemacs-startup-buffer-responsive t
;; Default major mode of the scratch buffer (default `text-mode')
dotspacemacs-scratch-mode 'text-mode
;; List of themes, the first of the list is loaded when spacemacs starts.
;; Press <SPC> T n to cycle to the next theme in the list (works great
;; with 2 themes variants, one dark and one light)
dotspacemacs-themes '(spacemacs-dark
spacemacs-light)
;; If non nil the cursor color matches the state color in GUI Emacs.
dotspacemacs-colorize-cursor-according-to-state t
;; Default font, or prioritized list of fonts. `powerline-scale' allows to
;; quickly tweak the mode-line size to make separators look not too crappy.
dotspacemacs-default-font '("Fira Mono for Powerline"
:size 15
:weight normal
:width normal
:powerline-scale 1.1)
;; The leader key
dotspacemacs-leader-key "SPC"
;; The key used for Emacs commands (M-x) (after pressing on the leader key).
;; (default "SPC")
dotspacemacs-emacs-command-key "SPC"
;; The key used for Vim Ex commands (default ":")
dotspacemacs-ex-command-key ":"
;; The leader key accessible in `emacs state' and `insert state'
;; (default "M-m")
dotspacemacs-emacs-leader-key "M-m"
;; Major mode leader key is a shortcut key which is the equivalent of
;; pressing `<leader> m`. Set it to `nil` to disable it. (default ",")
dotspacemacs-major-mode-leader-key ","
;; Major mode leader key accessible in `emacs state' and `insert state'.
;; (default "C-M-m")
dotspacemacs-major-mode-emacs-leader-key "C-M-m"
;; These variables control whether separate commands are bound in the GUI to
;; the key pairs C-i, TAB and C-m, RET.
;; Setting it to a non-nil value, allows for separate commands under <C-i>
;; and TAB or <C-m> and RET.
;; In the terminal, these pairs are generally indistinguishable, so this only
;; works in the GUI. (default nil)
dotspacemacs-distinguish-gui-tab nil
;; If non nil `Y' is remapped to `y$' in Evil states. (default nil)
dotspacemacs-remap-Y-to-y$ nil
;; If non-nil, the shift mappings `<' and `>' retain visual state if used
;; there. (default t)
dotspacemacs-retain-visual-state-on-shift t
;; If non-nil, J and K move lines up and down when in visual mode.
;; (default nil)
dotspacemacs-visual-line-move-text nil
;; If non nil, inverse the meaning of `g' in `:substitute' Evil ex-command.
;; (default nil)
dotspacemacs-ex-substitute-global nil
;; Name of the default layout (default "Default")
dotspacemacs-default-layout-name "Default"
;; If non nil the default layout name is displayed in the mode-line.
;; (default nil)
dotspacemacs-display-default-layout nil
;; If non nil then the last auto saved layouts are resume automatically upon
;; start. (default nil)
dotspacemacs-auto-resume-layouts nil
;; Size (in MB) above which spacemacs will prompt to open the large file
;; literally to avoid performance issues. Opening a file literally means that
;; no major mode or minor modes are active. (default is 1)
dotspacemacs-large-file-size 1
;; Location where to auto-save files. Possible values are `original' to
;; auto-save the file in-place, `cache' to auto-save the file to another
;; file stored in the cache directory and `nil' to disable auto-saving.
;; (default 'cache)
dotspacemacs-auto-save-file-location 'cache
;; Maximum number of rollback slots to keep in the cache. (default 5)
dotspacemacs-max-rollback-slots 5
;; If non nil, `helm' will try to minimize the space it uses. (default nil)
dotspacemacs-helm-resize nil
;; if non nil, the helm header is hidden when there is only one source.
;; (default nil)
dotspacemacs-helm-no-header nil
;; define the position to display `helm', options are `bottom', `top',
;; `left', or `right'. (default 'bottom)
dotspacemacs-helm-position 'bottom
;; Controls fuzzy matching in helm. If set to `always', force fuzzy matching
;; in all non-asynchronous sources. If set to `source', preserve individual
;; source settings. Else, disable fuzzy matching in all sources.
;; (default 'always)
dotspacemacs-helm-use-fuzzy 'always
;; If non nil the paste micro-state is enabled. When enabled pressing `p`
;; several times cycle between the kill ring content. (default nil)
dotspacemacs-enable-paste-transient-state nil
;; Which-key delay in seconds. The which-key buffer is the popup listing
;; the commands bound to the current keystroke sequence. (default 0.4)
dotspacemacs-which-key-delay 0.4
;; Which-key frame position. Possible values are `right', `bottom' and
;; `right-then-bottom'. right-then-bottom tries to display the frame to the
;; right; if there is insufficient space it displays it at the bottom.
;; (default 'bottom)
dotspacemacs-which-key-position 'bottom
;; If non nil a progress bar is displayed when spacemacs is loading. This
;; may increase the boot time on some systems and emacs builds, set it to
;; nil to boost the loading time. (default t)
dotspacemacs-loading-progress-bar t
;; If non nil the frame is fullscreen when Emacs starts up. (default nil)
;; (Emacs 24.4+ only)
dotspacemacs-fullscreen-at-startup nil
;; If non nil `spacemacs/toggle-fullscreen' will not use native fullscreen.
;; Use to disable fullscreen animations in OSX. (default nil)
dotspacemacs-fullscreen-use-non-native nil
;; If non nil the frame is maximized when Emacs starts up.
;; Takes effect only if `dotspacemacs-fullscreen-at-startup' is nil.
;; (default nil) (Emacs 24.4+ only)
dotspacemacs-maximized-at-startup nil
;; A value from the range (0..100), in increasing opacity, which describes
;; the transparency level of a frame when it's active or selected.
;; Transparency can be toggled through `toggle-transparency'. (default 90)
dotspacemacs-active-transparency 90
;; A value from the range (0..100), in increasing opacity, which describes
;; the transparency level of a frame when it's inactive or deselected.
;; Transparency can be toggled through `toggle-transparency'. (default 90)
dotspacemacs-inactive-transparency 90
;; If non nil show the titles of transient states. (default t)
dotspacemacs-show-transient-state-title t
;; If non nil show the color guide hint for transient state keys. (default t)
dotspacemacs-show-transient-state-color-guide t
;; If non nil unicode symbols are displayed in the mode line. (default t)
dotspacemacs-mode-line-unicode-symbols t
;; If non nil smooth scrolling (native-scrolling) is enabled. Smooth
;; scrolling overrides the default behavior of Emacs which recenters point
;; when it reaches the top or bottom of the screen. (default t)
dotspacemacs-smooth-scrolling t
;; Control line numbers activation.
;; If set to `t' or `relative' line numbers are turned on in all `prog-mode' and
;; `text-mode' derivatives. If set to `relative', line numbers are relative.
;; This variable can also be set to a property list for finer control:
;; '(:relative nil
;; :disabled-for-modes dired-mode
;; doc-view-mode
;; markdown-mode
;; org-mode
;; pdf-view-mode
;; text-mode
;; :size-limit-kb 1000)
;; (default nil)
dotspacemacs-line-numbers 'relative
;; Code folding method. Possible values are `evil' and `origami'.
;; (default 'evil)
dotspacemacs-folding-method 'evil
;; If non-nil smartparens-strict-mode will be enabled in programming modes.
;; (default nil)
dotspacemacs-smartparens-strict-mode nil
;; If non-nil pressing the closing parenthesis `)' key in insert mode passes
;; over any automatically added closing parenthesis, bracket, quote, etc…
;; This can be temporary disabled by pressing `C-q' before `)'. (default nil)
dotspacemacs-smart-closing-parenthesis nil
;; Select a scope to highlight delimiters. Possible values are `any',
;; `current', `all' or `nil'. Default is `all' (highlight any scope and
;; emphasis the current one). (default 'all)
dotspacemacs-highlight-delimiters 'all
;; If non nil, advise quit functions to keep server open when quitting.
;; (default nil)
dotspacemacs-persistent-server nil
;; List of search tool executable names. Spacemacs uses the first installed
;; tool of the list. Supported tools are `ag', `pt', `ack' and `grep'.
;; (default '("ag" "pt" "ack" "grep"))
dotspacemacs-search-tools '("ag" "pt" "ack" "grep")
;; The default package repository used if no explicit repository has been
;; specified with an installed package.
;; Not used for now. (default nil)
dotspacemacs-default-package-repository nil
;; Delete whitespace while saving buffer. Possible values are `all'
;; to aggressively delete empty line and long sequences of whitespace,
;; `trailing' to delete only the whitespace at end of lines, `changed'to
;; delete only whitespace for changed lines or `nil' to disable cleanup.
;; (default nil)
dotspacemacs-whitespace-cleanup nil
))
(defun dotspacemacs/user-init ()
"Initialization function for user code.
It is called immediately after `dotspacemacs/init', before layer configuration
executes.
This function is mostly useful for variables that need to be set
before packages are loaded. If you are unsure, you should try in setting them in
`dotspacemacs/user-config' first."
)
(defun dotspacemacs/user-config ()
"Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration.
This is the place where most of your configurations should be done. Unless it is
explicitly specified that a variable should be set before a package is loaded,
you should place your code here."
;; Sets Spacemacs macOS window view settings
(add-to-list 'default-frame-alist
'(ns-transparent-titlebar . t))
(add-to-list 'default-frame-alist
'(ns-appearance . dark)) ;; or light - depending on your theme
;; Sets window size and position
(if (eq system-type 'darwin)
;; If Mac
(setq initial-frame-alist '((top . 10) (left . 160) (width . 160) (height . 64)))
;; Else non-Mac
(setq initial-frame-alist '((top . 20) (left . 30) (width . 130) (height . 57)))
)
;; Org Mode -- count empty lines as blank separators
(setq org-cycle-separator-lines -1)
;; Org Mode -- agenda files
(setq org-agenda-files (list "~/Dropbox (Take-Two)/org/tasks"))
;; Org Mode -- capture file
(setq org-default-notes-file "~/Dropbox (Take-Two)/org/tasks/capture.org")
;; Ranger Mode -- kill all the buffers on exit
(setq ranger-cleanup-on-disable t)
;; Helm -- use ripgrep (rg) instead of silver searcher (ag)
(setq helm-ag-base-command "rg --vimgrep --no-heading --smart-case")
;; Autocomplete -- help tooltips
(setq auto-completion-enable-help-tooltip t)
;; Escape parenthesis
(define-key evil-insert-state-map (kbd "M-l") 'sp-up-sexp)
;; Python Mode -- code folding
(define-key evil-normal-state-map (kbd "z i") 'hs-hide-level)
;; Adds environment variables
(setq exec-path-from-shell-arguments '("-l"))
;; (with-temp-buffer
;; (insert-file-contents "/Users/noah.masur/Documents/GitHub/dotfiles/env.txt")
;; (while (search-forward-regexp "\\(.*\\)\n?" nil t)
;; (exec-path-from-shell-copy-env (match-string 1))
;; ))
;; (defun source-file-and-get-envs (filename)
;; (let* ((cmd (concat ". " filename "; env"))
;; (env-str (shell-command-to-string cmd))
;; (env-lines (split-string env-str "\n"))
;; (envs (mapcar (lambda (s) (replace-regexp-in-string "=.*$" "" s)) env-lines)))
;; (delete "" envs)))
;; (exec-path-from-shell-copy-envs (source-file-and-get-envs "/Users/noah.masur/.bash_profile"))
;; Starts emacsclient server to receive terminal commands
;; Add QR code
(defun kisaragi/qr-encode (str &optional buf)
"Encode STR as a QR code.
Return a new buffer or BUF with the code in it."
(interactive "MString to encode: ")
(let ((buffer (get-buffer-create (or buf "*QR Code*")))
(format (if (display-graphic-p) "PNG" "UTF8"))
(inhibit-read-only t))
(with-current-buffer buffer
(delete-region (point-min) (point-max)))
(make-process
:name "qrencode" :buffer buffer
:command `("qrencode" ,str "-t" ,format "-o" "-")
:coding 'no-conversion
;; seems only the filter function is able to move point to top
:filter (lambda (process string)
(with-current-buffer (process-buffer process)
(insert string)
(goto-char (point-min))
(set-marker (process-mark process) (point))))
:sentinel (lambda (process change)
(when (string= change "finished\n")
(with-current-buffer (process-buffer process)
(cond ((string= format "PNG")
(image-mode)
(image-transform-fit-to-height))
(t ;(string= format "UTF8")
(text-mode)
(decode-coding-region (point-min) (point-max) 'utf-8)))))))
(when (called-interactively-p 'interactive)
(display-buffer buffer))
buffer))
(org-reload)
(server-start)
)
;; Do not write anything past this comment. This is where Emacs will
;; auto-generate custom variable definitions.
(defun dotspacemacs/emacs-custom-settings ()
"Emacs custom settings.
This is an auto-generated function, do not modify its content directly, use
Emacs customize menu instead.
This function is called at the very end of Spacemacs initialization."
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages
(quote
(godoctor go-tag go-rename go-impl go-guru go-gen-test go-fill-struct go-eldoc flycheck-golangci-lint counsel-gtags counsel swiper company-go go-mode seeing-is-believing rvm ruby-tools ruby-test-mode ruby-refactor ruby-hash-syntax rubocopfmt rubocop rspec-mode robe rbenv rake minitest helm-gtags ggtags enh-ruby-mode dap-mode bui ivy chruby bundler inf-ruby tern company-quickhelp yasnippet-snippets yapfify yaml-mode xkcd ws-butler writeroom-mode visual-fill-column winum web-mode web-beautify volatile-highlights vimrc-mode vi-tilde-fringe uuidgen typit mmt treemacs-projectile treemacs-persp treemacs-magit treemacs-icons-dired treemacs-evil toml-mode toc-org tagedit symon symbol-overlay sudoku string-inflection sql-indent spaceline-all-the-icons all-the-icons memoize spaceline powerline smeargle slim-mode scss-mode sass-mode reveal-in-osx-finder restclient-helm restart-emacs ranger rainbow-delimiters racer pytest pyenv-mode py-isort pug-mode prettier-js popwin pippel pipenv pyvenv pip-requirements phpunit phpcbf php-extras php-auto-yasnippets persp-mode password-generator paradox pacmacs overseer osx-trash osx-dictionary osx-clipboard orgit org-superstar org-projectile org-category-capture org-present org-pomodoro alert log4e gntp org-mime org-download org-cliplink org-brain open-junk-file ob-sml sml-mode ob-restclient ob-http nodejs-repl nginx-mode nameless move-text mmm-mode markdown-toc magit-svn magit-section magit-gitflow magit-popup macrostep lsp-ui lsp-treemacs treemacs pfuture lsp-python-ms lorem-ipsum livid-mode skewer-mode live-py-mode link-hint launchctl json-navigator hierarchy js2-refactor multiple-cursors js2-mode js-doc indent-guide importmagic epc ctable concurrent deferred impatient-mode simple-httpd hungry-delete htmlize hl-todo highlight-parentheses highlight-numbers parent-mode highlight-indentation helm-xref helm-themes helm-swoop helm-pydoc helm-purpose window-purpose imenu-list helm-projectile helm-org-rifle helm-org helm-mode-manager helm-make helm-lsp lsp-mode spinner ht dash-functional helm-ls-git helm-gitignore helm-git-grep helm-flx helm-descbinds helm-dash dash-docs helm-css-scss helm-company helm-c-yasnippet helm-ag haml-mode google-translate golden-ratio gnuplot gitignore-templates gitignore-mode gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link gh-md geben fuzzy flycheck-rust flycheck-pos-tip pos-tip flycheck-package package-lint let-alist flycheck-elsa flycheck flx-ido flx fill-column-indicator fancy-battery eyebrowse expand-region evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-textobj-line evil-surround evil-org evil-numbers evil-nerd-commenter evil-matchit evil-magit magit git-commit with-editor evil-lisp-state evil-lion evil-indent-plus evil-iedit-state evil-goggles evil-exchange evil-escape evil-ediff evil-cleverparens smartparens evil-args evil-anzu anzu eval-sexp-fu emr iedit clang-format projectile paredit list-utils pkg-info epl emmet-mode elisp-slime-nav editorconfig dumb-jump drupal-mode dockerfile-mode docker transient tablist json-mode docker-tramp json-snatcher json-reformat devdocs dash-at-point dactyl-mode cython-mode csv-mode company-web web-completion-data company-terraform terraform-mode hcl-mode company-statistics company-restclient restclient know-your-http-well company-phpactor phpactor composer php-runtime request company-php ac-php-core xcscope php-mode company-anaconda company column-enforce-mode clean-aindent-mode centered-cursor-mode cargo markdown-mode rust-mode blacken auto-yasnippet yasnippet auto-highlight-symbol auto-compile packed anaconda-mode pythonic f dash s aggressive-indent ace-window ace-link ace-jump-helm-line helm avy helm-core ac-ispell auto-complete popup 2048-game which-key use-package pcre2el org-plus-contrib hydra lv hybrid-mode font-lock+ evil goto-chg undo-tree dotenv-mode diminish bind-map bind-key async))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
)

View File

@ -1 +0,0 @@
Directory to store layers

View File

@ -1,93 +0,0 @@
# ls aliases
alias ls='exa'
alias ll='ls -alhF'
alias la='ls -A'
alias l='ls -CFA'
alias lh='ls -l'
# alias lh='ls -lhtraF'
# Old aliases
alias inv='source ~/.venv/inventorybot/bin/activate'
alias awscli='source ~/.venv/aws/bin/activate'
alias gstory='source ~/.venv/gstory/bin/activate'
alias stu='source ~/.venv/stupid/bin/activate'
alias r='/projects/device42/run'
alias qu='/projects/device42/utils/quickupdate-noah'
alias qudb='/projects/device42/utils/debug-noah'
alias dlog='/projects/device42/logwatch.sh'
alias hlog='/projects/soc-utils/Hive_Bot/utils/logwatch.sh'
alias bot='cd /projects/device42/inventorybot'
alias tap='terraform apply'
alias mod='cd /projects/terraform/modules'
alias hs='cd /projects/soc-utils/Hive_Scripts'
alias esc='cd /projects/soc-utils/Hive_Responders/Escalator'
# Emacs
emacsenv='~/Documents/GitHub/dotfiles/bin/emacs_env'
# Vim
if (which nvim > /dev/null)
then
alias vim='nvim'
fi
# Improved CLI Tools
alias ping='prettyping --nolegend'
alias cat='bat'
alias icat='$PROJ/dotfiles/iterm/imgcat'
alias h='http -Fh --all'
# Fun CLI Tools
alias search='googler -j'
alias checkip='curl checkip.amazonaws.com'
alias weather='curl wttr.in'
alias moon='curl wttr.in/Moon'
alias ipinfo='curl ipinfo.io'
alias worldmap='telnet mapscii.me'
# Dotfile and config shortcuts
alias aliases='edit $DOTS/zsh/aliases'
alias zenv='edit $DOTS/zsh/env'
alias zrc='edit $DOTS/zsh/zrcsh.symlink'
alias reload='source ~/.zshrc'
alias runbootstrap='$DOTS/scripts/bootstrap'
alias sshc='edit ~/.ssh/config'
alias hosts='edit /sudo:root@localhost:/etc/hosts'
# Navigation shortcuts
alias dots='cd $DOTS'
alias org='cd ~/Dropbox\ \(Take-Two\)/org'
alias proj='cd $PROJ'
alias tpt='cd $PROJ/thirdpartytrust'
alias hv='cd $PROJ/soc-utils/Hive_Bot/hivebot'
alias tf='cd $TFDIR'
alias slack='cd $PROJ/slack'
alias misty='cd $PROJ/misty'
alias dl='cd ~/Downloads'
alias ssl='echo openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr'
# Virtualenv
alias d='deactivate'
alias pv='cd $WORKON_HOME'
alias ip='source $WORKON_HOME/ipython/bin/activate'
alias tp='source $WORKON_HOME/thirdpartytrust/bin/activate'
alias hive='source $WORKON_HOME/hivebot/bin/activate'
# Docker
alias dc='$DOTS/bin/docker_cleanup'
alias dr='docker run'
alias db='docker build . -t'
alias connect='docker run --rm -v ~/.aws:/root/.aws -v ~/.ssh:/root/.ssh -it connect-aws'
# Python
alias py='python'
alias domisty='cd $PROJ/misty && ./buildrun.sh'
# Rust
alias ca='cargo'
# Non-MacOS
if [ $(uname) = "Linux" ]; then
alias pbcopy='xclip -selection clipboard -in'
alias pbpaste='xclip -selection clipboard -out'
fi

44
zsh/env
View File

@ -1,44 +0,0 @@
# If you come from bash you might have to change your $PATH.
export PATH="$HOME/bin:/usr/local/bin:$PATH"
# Add pyenv
export PATH="$HOME/.pyenv/bin:$PATH"
# eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
# Add cargo
export PATH="$HOME/.cargo/bin:$PATH"
# Add ruby
export RUBY_HOME=/usr/local/opt/ruby/bin
export PATH=$RUBY_HOME:$PATH
# Add dotfiles programs
export PATH="$DOTS/bin:$PATH"
# Add local programs
export PATH="$HOME/.local/bin:$PATH"
# Certificates
# export AWS_CA_BUNDLE=~/.aws/Palo-Root.cer
# export CA_BUNDLE=~/.aws/Palo-Root.cer
# export CURL_CA_BUNDLE=~/.aws/Palo-Root.cer
# export REQUESTS_CA_BUNDLE=~/.aws/Palo-Root.cer
# Directory Shortcuts
export PROJ=$HOME/Documents/GitHub
export TFDIR=$PROJ/terraform
export WORKON_HOME=~/.pyenv/versions
# CDPATH for convenient cd shortcuts
CDPATH="$HOME:$PROJ"
# Syntax Highlighting
if [ -f /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
fi
# Auto Suggestions
if [ -f /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]; then
source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh
fi

View File

@ -1,145 +0,0 @@
# Open in Emacs
edit() {
emacsclient --no-wait --alternate-editor="emacs" "$@" &> /dev/null & disown
}
# Create QR code from link
qr() { qrencode "$1" -t ANSIUTF8 -o -; }
# Open directory in projects
prj() {
local projdir
projdir=$(ls $PROJ | fzf)
if [[ -z $projdir ]]
then
return 1
else
cd $projdir
fi
}
# Activate pyenv virtualenv
venv() {
source ~/.pyenv/versions/$1/bin/activate
}
# Temporarily enter iPython interpreter with its Pyenv
ipy() {
STORED_VENV=$VIRTUAL_ENV
source $WORKON_HOME/ipython/bin/activate && \
ipython && \
deactivate && \
if [ $STORED_VENV ]; then
source $STORED_VENV/bin/activate
fi
}
# Run pylint on all python files
lint() {
fd -IH -t f .py$ | xargs pylint
}
# Stolen from: https://github.com/davidpdrsn/dotfiles/blob/master/zsh/functions
# Extract archives
extract() {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
# fe [FUZZY PATTERN] - Open the selected file with the default editor
# - Bypass fuzzy finder if there's only one match (--select-1)
# - Exit if there's no match (--exit-0)
fe() {
local file
file=$(fzf --query="$1" --select-1 --exit-0)
[ -n "$file" ] && ${EDITOR:-vim} "$file"
}
# fd - cd to selected directory
fcd() {
local dir
dir=$(find ${1:-*} -path '*/\.*' -prune \
-o -type d -print 2> /dev/null | fzf +m) &&
cd "$dir"
}
# dir - fd name of dir in this directory
dir() {
# fd ".*$1.*" -H -d 1
ls -lha | rg "$1"
}
# vers - switch to pyenv virtualenv with fuzzy menu
vers() {
local version
version=$(pyenv versions --bare --skip-aliases | fzf)
if [[ -z $version ]]
then
return 1
else
source $WORKON_HOME/$version/bin/activate
fi
}
# unsetaws - remove all AWS environment variables
unsetaws() {
unset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY
}
copy() {
cat $1 | pbcopy
}
cloud() {
profile=${$1:-default}
search=${2:-prod}
num=${$3:-1}
ips=$(drips --raw | grep $search)
if [[ -z $ips ]]
then
echo "Failed to find instances."
return 1
fi
count=$(echo $ips | wc -l)
echo "Found ${count##*( )} instances."
ip=$(echo $ips | sed -n "$num"p | awk -F' - ' '{print $2}')
if [[ -z $ip ]]
then
echo "Not an available selection."
return 1
fi
update-ssh-config --host $search --hostname $ip
ssh $search
}
journal() {
today=$(date -j +"%Y-%m-%d_%a")
today_journal=$HOME/Documents/notes/journal/$today.md
if [[ -f $today_journal ]]
then
echo "Already exists."
else
yesterday=$(date -jv "-1d" +"%Y-%m-%d_%a")
tomorrow=$(date -jv "+1d" +"%Y-%m-%d_%a")
printf "[[journal/$yesterday|Previous]] - [[calendar|Index]] - [[journal/$tomorrow|Next]]\n\n---\n\n# Tasks\n\n\n# Log\n\n\n# Communication\n\n---\n\n# Meetings\n\n" > $today_journal
echo "New journal added."
fi
}

View File

@ -1,107 +0,0 @@
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# ZSH_THEME="remy"
# ZSH_THEME="agnoster"
# ZSH_THEME="typewritten"
ZSH_THEME="nicoulaj"
# Removes the prompt when encountering a .env file
ZSH_DOTENV_PROMPT=false
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS=true
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=~/.zsh/custom
# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
ripgrep
docker
dotenv
osx
cargo
gem
)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Auto-Suggestions
export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=60"
export ZSH_AUTOSUGGEST_STRATEGY=(completion history)
bindkey '^ ' autosuggest-accept
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zsh/cache

18
zsh/vim
View File

@ -1,18 +0,0 @@
### Activate vi / vim mode:
bindkey -v
# Remove delay when entering normal mode (vi)
KEYTIMEOUT=5
# Change cursor shape for different vi modes.
function zle-keymap-select {
if [[ $KEYMAP == vicmd ]] || [[ $1 = 'block' ]]; then
echo -ne '\e[1 q'
elif [[ $KEYMAP == main ]] || [[ $KEYMAP == viins ]] || [[ $KEYMAP = '' ]] || [[ $1 = 'beam' ]]; then
echo -ne '\e[6 q'
fi
}
zle -N zle-keymap-select
# Start with beam shape cursor on zsh startup and after every command.
zle-line-init() { zle-keymap-select 'beam'}

View File

@ -1,12 +0,0 @@
DOTFILE=`readlink ~/.zshrc`
export DOTS=`dirname "$(dirname $DOTFILE)"`
source $DOTS/zsh/env
source $DOTS/zsh/ohmyzsh
source $DOTS/zsh/aliases
source $DOTS/zsh/functions
source $DOTS/zsh/vim
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
#source ~/.iterm2_shell_integration.zsh