Skip to content

Instantly share code, notes, and snippets.

View scajanus's full-sized avatar

Sakari Cajanus scajanus

View GitHub Profile
10.10.2012
Unimplemented destructors no longer throw exceptions and cause std::terminate.
PlayerEntry no longer has a destructor making it less fragile. Possible memory leaks are now avoided by a call to endGame() in ~GameContext().
Exception handling has been extended in main.cc and main_gui.cc to prevent std::terminate.
Minor annoyance in ui.hh has been fixed and the dominion.model has been updated accordingly.
12.10.2012
Fixed the given playReaction function in turn.cc. Raises an onReact event instead of onTrash event.
15.10.2012
jos buy<=0
heitä logicerror
kortti = getselectedcard
gaincard(kortti)
if(coin<kortti->cost)
heitä logicerror
buys--
coin -= kortti->cost
#!/usr/local/bin/perl
use warnings;
use strict;
use File::DosGlob qw(bsd_glob); # to get sane whitespace semantics
die "Usage: $0 new\n" unless @ARGV == 1;
my $pattern = '/u/lcajanus/MATLAB/GPstuff-svn/*/*.m';
my @mfiles = glob $pattern;
@scajanus
scajanus / make
Created October 30, 2012 16:18
Make settings for C++
nnoremap <F4> :!clear<CR>:!make clean<CR>:wa\|:make<CR>
nnoremap <F5> :!clear<CR>:wa\|:make<CR>
nnoremap <F6> :!./main<CR>
autocmd FileType cpp call <SID>cppstuff()
function! <SID>cppstuff()
if filereadable("Makefile")
set makeprg=make
else
set makeprg=g++\ -std=c++0x\ -Wall\ -Wextra\ -pedantic\ -g\ -D_GLIBCXX_DEBUG\ -o\ main\ %:h/*.cc
( x=`tput op` y=`printf %$((${COLUMNS}-6))s`;for i in {0..16};do o=00$i;echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}$x;done; )
Ncurses:
(Using sources from Ubuntu repository)
Configure flags for ncurses with wide character support:
./configure --prefix=$HOME/local --enable-widec --with-shared --without-debug
make && make install
Weechat:
(Sources downloaded from weechat site)
Point the weechat configure script to right place:
env CFLAGS="-I$HOME/local/include" -LDFLAGS="-L$HOME/local/lib" cmake .. -DPREFIX=$HOME/local
gnome-terminal --geometry 90x100 -x vim %f +%l +"normal %c|" --cmd "set term=xterm-256color"
3206;3143;3147;3183;3056;3057;3056;3055;3053;3054;3053;3148;3068;3058;3056;3058;3066;3066;3008;3002;3065;3068;3031;3011;3146;3122;3123;3031;3101;3102;3012;3144;3145;3032;3039;3051;3070;3207;3181;3181;3072;3121;3011;3015;3205;3006;3141;3006;3182;3183;3004;3182;3142;3181;3013
184 autocmd FileType tex call <SID>latexstuff()
185 function! <SID>latexstuff()
186 set makeprg=pdflatex\ %:h/*.tex
187 nnoremap <F5> :!clear<CR>:w\|:make<CR><CR>
188 endfunction