Skip to content

Instantly share code, notes, and snippets.

View scajanus's full-sized avatar

Sakari Cajanus scajanus

View GitHub Profile
Realize the function name does not actually contain "All" when filling
the last column in the table. Jump back to the function name with ?All<CR>.
How to most easily delete this match with the cursor now on it?
|Fleet update all| runFleetUpdateAllQuickBatch() | running | <cursor>
@scajanus
scajanus / VisSubstitute.vim
Created April 7, 2015 05:38
Add \%V to substitute pattern
com! -nargs=1 -bar -range Substitute <line1>,<line2>call Substitute(<q-args>)
function! Substitute(arg) range
let arglist = split(a:arg, '/')
echo arglist
exec a:firstline.",".a:lastline . 'substitute/\%V'.arglist[0].'\%V/'.arglist[1].'/'.arglist[2]
endfun
KRS huon. tyyppi m^2 MH Laina VH
3 B 31 2h+kt 44,0 87 300 € 131 200 € 218 500 € Vapaa
2 B 24 2h+kt 40,5 87 700 € 131 800 € 219 500 € Vapaa
4 B 36 2h+kt 44,0 89 200 € 134 000 € 223 200 € Vapaa
3 B 28 2h+kt 40,5 89 700 € 134 800 € 224 500 € Vapaa
4 B 33 2h+kt 40,5 90 900 € 136 600 € 227 500 € Vapaa
5 B 41 2h+kt 44,0 91 300 € 137 200 € 228 500 € Vapaa
5 B 38 2h+kt 40,5 93 900 € 141 600 € 235 500 € Vapaa
6 B 45 2h+kt 44,0 95 200 € 143 000 € 238 200 € Vapaa
6 B 43 2h+kt 40,5 96 500 € 145 000 € 241 500 € Vapaa
RE: voima:
3 x 8 = 24 3 x 4 = 12
3 x 9 = 27 3 x 5 = 15
3 x 10 = 30 4 x 4 = 16
4 x 8 = 32 3 x 6 = 18
3 x 11 = 33 4 x 5 = 20
3 x 12 = 36 5 x 4 = 20
4 x 9 = 36 4 x 6 = 24
4 x 10 = 40 6 x 4 = 24
5 x 8 = 40 5 x 5 = 25
"In .vimrc:
let $VIMHOME=expand('<sfile>:p:h')
function! ColorschemeAfter()
let l:path = $VIMHOME . "/after/colorscheme/" . g:colors_name . ".vim"
if filereadable(l:path)
exec "source " . l:path
end
endfunction
  1. numbered thing

    • list thing

    • 'o' on the previous line puts me here

    • 'o' on the previous line puts me here

@scajanus
scajanus / ollille.py
Created January 13, 2015 09:00
Regex stuff
import re
line="<td>id=j_i dt133_j_idt134_j_idt188_j_idt189_uitwc_0_uitwc_0_U20</td> muotoon <td>css=[id$=U20]</td>"
#pitää siis tunnistaa rivit joissa tuo id:n sisältö loppuu johonkin U-alkuiseen stringiin ja siirtää se U-osuus tuohon uuteen muotoon.
m = re.search("id\=[\w_]*_(U\w*)</td>",line)
try:
print m.group(1)
line2 = "<td>css=[id$="
line2 +=m.group(1)
line2 +="]</td>"
print (line2)
15:27 <sakkemo> Well if I want to learn how to optimize vim and personalize it for myself. Then using a Vim distro
15:27 <vimgor> Rumor has it Well if I want to learn how to optimize vim and personalize it for myself. Then using a Vim distro is not the right approach., sakkemo
15:27 <sakkemo> forget Well if I want to learn how to optimize vim and personalize it for myself. Then using a Vim distro
15:27 <vimgor> 10-4.
15:27 <sakkemo> Well if I want to learn how to optimize vim and personalize it for myself. Then using a Vim distro
15:27 <vimgor> I have no idea!
@scajanus
scajanus / html.vim
Created December 16, 2014 09:22
$VIMRUNTIME/indent/html.vim for vim 7.4.417
" Vim indent script for HTML
" General: "{{{
" File: html.vim (Vimscript #2075)
" Author: Andy Wokula <anwoku@yahoo.de>
" Last Change: 2013 Jun 12
" Rev Days: 13
" Version: 0.9
" Vim Version: Vim7
" Description:
" Improved version of the distributed html indent script, faster on a
Ootko nähny leffaa Eero? Interstellar aliarvioi katsojaa
selittämällä auki kaikki juonen kannalta oleelliset yksityiskohdat. Omalle
tulkinnalle tai ajattelulle ei jää sijaa. Vastaavasti katsoja ja koko
yleisö johdatetaan kädestä pitäen ja alleviivaten tuntemaan ennalta
määrätty tunne tietyssä kohtaa. Tunne ei synny henkilöiden mukana
elämisestä ja kokemisesta, vaan iloisesti täyteen ladatuista kohtauksista.
Tapa on toki toimiva siinä hetkessä: Vietin teatterissa aikaa tippa
silmässä useammassa kohtauksessa. Jälkeenpäin olo on kuitenki halpa ja
hyväksikäytetty, eikä käteen jää muuta kuin fiilis huijatuksi tulemisesta.
Vastaava ilmiö on, jos kauhuelokuvan "kauhu" perustuu vain katsojan