Skip to content

Instantly share code, notes, and snippets.

View elliotwesoff's full-sized avatar

Elliot Wesoff elliotwesoff

View GitHub Profile
def quicksort(arr, left, right):
if left < right:
partition_pos = partition(arr, left, right)
quicksort(arr, left, partition_pos - 1)
quicksort(arr, partition_pos + 1, right)
def partition(arr, left, right):
i = left
j = right - 1
pivot = arr[right]
call plug#begin()
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'preservim/nerdtree'
Plug 'preservim/nerdcommenter'
Plug 'rking/ag.vim'
Plug 'vim-syntastic/syntastic'
Plug 'puremourning/vimspector'
Plug 'vim-ruby/vim-ruby'
Plug 'rafi/awesome-vim-colorschemes'
@elliotwesoff
elliotwesoff / python-cli-template.py
Created September 25, 2021 04:24
python cli template
import sys
import logging
import traceback
from optparse import OptionParser
def main():
(options, args) = setup()
return 0
def setup():
@elliotwesoff
elliotwesoff / wa-hide.js
Created June 8, 2021 04:41
Hide WebAssign responses and answer keys
// copy and paste this function and call into your browser's dev tools console.
// use hideAnswers(false) to show the responses and answer keys again after initially hiding them.
function hideAnswers(hide) {
const selectors = '.static, .mq-root-block, input, div.solutionContainer, span.seenKey, img[alt*=answer], img[alt*=infinity], img[alt*="-infinity"], img[src*=symimage]';
document.getElements(selectors).forEach(e => e.style.display = hide ? 'none' : 'inherit');
}
hideAnswers(true);
@elliotwesoff
elliotwesoff / naruto.py
Last active June 7, 2021 00:07
Naruto manga downloader
import time
import pathlib
import requests
from optparse import OptionParser
base_url = 'https://official-complete-2.eorzea.us/manga/Naruto'
consecutive_error_threshold = 5
def setup():
parser = OptionParser()
@elliotwesoff
elliotwesoff / py-stop-snippet.cson
Created September 4, 2019 00:03
Python code interact in Atom, with globals and locals
'.source.python':
'code':
'prefix': 'stop'
'body': 'import code; code.interact(local=dict(globals(), **locals()))'
@elliotwesoff
elliotwesoff / elliot.bat
Created March 22, 2017 14:26
windows-cmd-shortcuts.bat
@echo off
doskey gs=git status
doskey gl=git log
doskey gd=git diff
doskey gb=git branch
doskey l=ls -lah
doskey size=du -sh
doskey e=explorer
doskey hosts=vim C:\Windows\System32\drivers\etc\hosts
@elliotwesoff
elliotwesoff / messenger.html
Last active March 13, 2017 15:57
Little bb messenger window yay!
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<script>
var height = 300;
var width = 500;
@elliotwesoff
elliotwesoff / setup-dev-environment
Created November 8, 2016 17:12
Script to quickly setup necessary tools for a Linux dev environment.
#!/bin/bash
function process_failed {
echo "${1} didn't download correctly"
}
# download vimrc and add to system vimrc
# wget -O ~/.vimrc https://gist.githubusercontent.com/elliotwesoff/f34e786b07209c5e25d4d1f650609771/raw/3c2939e9625ca9f890757be05819a563f57059e7/vimrc
if [ "$?" -eq 1 ]; then process_failed vimrc; else echo vimrc OK; fi
" Vim color file
" Converted from my Textmate Code School theme using Coloration
" http://astonj.com
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
endif