This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import logging | |
import traceback | |
from optparse import OptionParser | |
def main(): | |
(options, args) = setup() | |
return 0 | |
def setup(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'.source.python': | |
'code': | |
'prefix': 'stop' | |
'body': 'import code; code.interact(local=dict(globals(), **locals()))' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<meta charset="utf-8" /> | |
<script> | |
var height = 300; | |
var width = 500; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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 |
NewerOlder