Skip to content

Instantly share code, notes, and snippets.

View scajanus's full-sized avatar

Sakari Cajanus scajanus

View GitHub Profile
diff --git a/moonboard/views.py b/moonboard/views.py
index c400614..b80a3c6 100644
--- a/moonboard/views.py
+++ b/moonboard/views.py
@@ -34,20 +34,8 @@ def problemListView(request):
max_grade = request.GET.get('max_grade', '8C')
sorted_by = request.GET.get('sortedBy','')
gradelist = ["5", "5+", "6A", "6A+", "6B", "6B+", "6C", "6C+", "7A", "7A+", "7B", "7B+", "7C", "7C+", "8A", "8A+", "8B", "8B+", "8C"]
- filtered_gradelist = []
- record=False
syn match LeadingWhiteSpace /\(^ *\)\@<= / conceal cchar=.
set conceallevel=2
set concealcursor=nvic
@scajanus
scajanus / mapA-Z.vim
Created June 19, 2016 08:46
Looping over characters for a mapping
for i in range(65,90)
exec 'inoremap <expr> ' . nr2char(i) . ' col(".")<20 ? ' . '"" : "' . nr2char(i) . '""'
endfor
@scajanus
scajanus / betterStar.vim
Created June 10, 2016 13:43
Make * and # first highlight, then move cursor
nnoremap <expr> * @/=='\<'.expand('<cword>').'\>' ? '*' : ":let @/='\\<'.expand('<cword>').'\\>'<CR>"
nnoremap <expr> # @/=='\<'.expand('<cword>').'\>' ? '#' : ":let @/='\\<'.expand('<cword>').'\\>'<CR>"
Once I get on a puzzle I can’t get away. If my mother’s friend had said,
“Never mind, it’s too much work,” I’d have blown my top, because I want to
beat this damn thing, as long as I’ve gone this far. I can’t just leave it
after I’ve found out so much about it. I have to keep going to find out
ultimately what is the matter with it in the end.
That’s a puzzle drive. It’s what accounts for my wanting to decipher Mayan
hieroglyphics, for trying to open safes. I remember in high school, during
first period a guy would come to me with a puzzle in geometry, or
something which had been assigned in his advanced math class. I wouldn’t
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
let g:colors_name = "ph"
@scajanus
scajanus / colorschemeAfter.vim
Created November 26, 2015 17:45
Add support for $HOME/.vim/after/colors/
function! ColorschemeAfter()
exec "runtime! colors/" . g:colors_name . ".vim"
endfunction
augroup colors
autocmd!
au ColorScheme * call ColorschemeAfter()
augroup end
s/\w\+$/\=spellbadword(submatch(0))[1] == 'bad' && spellbadword(submatch(0)[:-2])[1] == '' ? submatch(0)[:-2] : submatch(0)
@scajanus
scajanus / IndentOnWrite.vim
Created November 20, 2015 07:29
Switch to 2 spaces on writing and back to 4 afterwards
au BufWritePre *.c set ts=4 noet | retab! | set ts=2 et | retab
au BufWritePost *.c set ts=2 noet | retab! | set ts=4 et | retab
@scajanus
scajanus / GetTexEnv.vim
Last active September 12, 2015 14:19
GetTexEnv.vim
function! GetTexEnv()
let s:env = substitute(getline('.'), '^\s*\\begin{\ze', '', '')
return "}\<CR>\<CR>\\end{" . s:env . "}\<Up>"
endfunction
inoremap <expr> } getline('.') =~ '^\s*\\begin{[^}]\+' ? GetTexEnv() : '}'