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
" quick add plugins for a plugin manager to load {{{1 | |
function! AddPacFromCb() abort | |
if v:version >= 801 || (v:version == 800 && has("patch1630")) | |
let l:cb = trim(@+) | |
else | |
" do oldschool way to trim all spaces and whatnot | |
let l:cb = substitute(@+,'\v^\s*(.{-})\s*\n$','\1','') | |
endif | |
let l:cb = substitute(l:cb, '\v^https://github.com/','','') | |
put = 'Plugin ''' . l:cb . '''' |
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
" even easier with `.\{-}`: | |
%s/\[\(.\{-}\)](\(.\{-}\))/[[\2][\1]]/g |
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
var names = document.body.getElementsByClassName('gameListRowItemName'); | |
var namesString = ''; | |
for (var i = 0; i < names.length; i++) namesString += (names[i].innerText + '\n'); |
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
" screen line scroll - very useful with wrap on | |
" https://bluz71.github.io/2017/05/15/vim-tips-tricks.html | |
nnoremap <expr> j v:count ? (v:count > 5 ? "m'" . v:count : '') . 'j' : 'gj' | |
nnoremap <expr> k v:count ? (v:count > 5 ? "m'" . v:count : '') . 'k' : 'gk' |
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
#!/usr/bin/env python3.6 | |
# -*- coding: utf-8 -*- | |
# dror - pathlib edition | |
# Based on https://gist.github.com/dansku/9040240#file-dropboxorganize-py | |
__lastchanged__ = '2018-06-07 06:07' | |
__verstion__ = '0.6.2' | |
from datetime import date | |
from pathlib import Path | |
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
" Auto-insert closing parenthesis/brace {{{2 | |
" TODO: make bracket insertion a little smarter | |
" right now it gets in the way more than it helps | |
inoremap ( ()<Left> | |
inoremap { {}<Left> | |
inoremap [ []<Left> | |
" Auto-delete closing parenthesis/brace | |
function! BetterBackSpace() abort | |
let cur_line = getline('.') |
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
#!/usr/bin/env python3 | |
import os | |
import zipfile | |
def printProgressBar (iteration, total, prefix = '', suffix = '', decimals = 0, | |
length = 100, fill = '█', span = ' '): | |
""" | |
Call in a loop to create terminal progress bar | |
@params: | |
iteration - Required : current iteration (Int) | |
total - Required : total iterations (Int) |
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
#!/usr/bin/env python3.6 | |
# dror - datetime format edition | |
# Based on https://gist.github.com/dansku/9040240#file-dropboxorganize-py | |
# 2018-05-14: convert to Pathlib; remove .encode('utf-8'); add alt output template | |
__verstion__ = '0.5.2' | |
import os.path | |
import glob | |
from datetime import date | |
from pathlib import Path |
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 | |
if exist "%USERPROFILE%\vimfiles" ( if not exist "%USERPROFILE%\vimfiles_" (move "%USERPROFILE%\vimfiles" "%USERPROFILE%\vimfiles_") else (echo "0 -> _ failed, _ exists")) | |
if exist "%USERPROFILE%\vimfiles1" ( if not exist "%USERPROFILE%\vimfiles" (move "%USERPROFILE%\vimfiles1" "%USERPROFILE%\vimfiles") else (echo "1 -> 0 failed, 0 exists")) | |
if exist "%USERPROFILE%\vimfiles_" ( if not exist "%USERPROFILE%\vimfiles1" (move "%USERPROFILE%\vimfiles_" "%USERPROFILE%\vimfiles1") else (echo "_ -> 1 failed, 1 exists")) |
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
nnoremap <expr> <leader><Tab> getline('.') =~ "\"" ? "m1A {{{1<Esc>`1" : "m1A \" {{{1<Esc>`1" | |
nnoremap <expr> <leader>1<Tab> getline('.') =~ "\"" ? "m2A }}}1<Esc>`2" : "m1A \" }}}1<Esc>`2" | |
inoremap <expr> <localleader><Tab> getline('.') =~ "\"" ? "<Esc>m1A {{{1<C-o>`1" : "<Esc>m1A\" {{{1<C-o>`1" | |
inoremap <expr> <localleader>1<Tab> getline('.') =~ "\"" ? "<Esc>m2A }}}1<C-o>`2" : "<Esc>m2A\" }}}1<C-o>`2" |