Skip to content

Instantly share code, notes, and snippets.

Ruben Verweij rbnvrw

Block or report user

Report or block rbnvrw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rbnvrw
rbnvrw / README.md
Last active Mar 10, 2020
Annotate, convert, crop, speed-up, scalebar overlay of an ND2 movie
View README.md

See the Python notebook for the code. If you scroll down all the way down, you see an example of the last frame in a tracked, cropped and sped-up video. Features:

  • Convert an ND2 movie into avi/mp4/mov/wmv format
  • Add a scalebar of your choice to the movie
  • Speed-up the movie by a certain factor
  • With a csv file containing (frame,x,y,r,particle) columns: overlay the trajectories, particle number, circle of tracked radius
@rbnvrw
rbnvrw / build.sh
Last active May 14, 2016
Building Vim from source on Fedora 23 (see http://www.rubenverweij.nl/2016/05/building-vim-74-from-source-on-fedora-23.html for an explanation)
View build.sh
sudo dnf install -y ruby ruby-devel lua lua-devel luajit \
luajit-devel ctags git python python-devel \
python3 python3-devel tcl-devel \
perl perl-devel perl-ExtUtils-ParseXS \
perl-ExtUtils-XSpp perl-ExtUtils-CBuilder \
perl-ExtUtils-Embed
# symlink xsubpp (perl) from /usr/bin to the perl dir
sudo ln -s /usr/bin/xsubpp /usr/share/perl5/ExtUtils/xsubpp
git clone https://github.com/vim/vim.git vim-src
cd vim-src
@rbnvrw
rbnvrw / .vimrc
Created Mar 15, 2016
Pandoc tables
View .vimrc
function! s:tablePandoc() range
exe "'<,'>Tabularize /|"
let hsepline= substitute(getline("."),'[^|]','-','g')
exe "norm! o" . hsepline
exe "'<,'>s/-|/ |/g"
exe "'<,'>s/|-/| /g"
exe "'<,'>s/^| \\|\\s*|$\\||//g"
exe "'<,'>!pandoc -f markdown -t rst"
endfunction
command! -range=% TablePandoc :call <SID>tablePandoc()
@rbnvrw
rbnvrw / .vimrc
Last active Mar 12, 2016
Quick vim tips
View .vimrc
" move vertically by visual line
nnoremap j gj
nnoremap k gk
" highlight just the 81st column of wide lines... (Damian Conway)
highlight ColorColumn ctermbg=magenta
call matchadd('ColorColumn', '\%81v', 100)
" Enable code folding
set foldenable
@rbnvrw
rbnvrw / fix_after_scan.bimp
Created Oct 20, 2015
GIMP batch scripts (BIMP)
View fix_after_scan.bimp
#BIMP 1.16
#MANIPULATION SET DEFINITION
[USERDEF0]
procedure=plug-in-despeckle
num_params=7
PARAM0=1
PARAM1=NOT_USED
PARAM2=NOT_USED
PARAM3=2
@rbnvrw
rbnvrw / LaTeXScaleBars.md
Last active Sep 4, 2018
Adding scalebars to images in LaTeX
View LaTeXScaleBars.md

Scalebar with background

Scalebar with background

To change the backgroundcolor, adjust the scalebgcolor variable to use the desired color. Add the following code to your preamble:

\usepackage{tikz}
\usepackage[usenames, dvipsnames]{color}
\definecolor{scalebgcolor}{rgb}{0.08,0.52,0.80}
@rbnvrw
rbnvrw / latex-snippets.md
Last active Aug 29, 2015
Usefull LaTeX snippets
View latex-snippets.md

Framed equations

\usepackage{empheq}
\usepackage[many]{tcolorbox}

\tcbset{
  highlight math style={
    enhanced,
    colframe=black,
    colback=white,
@rbnvrw
rbnvrw / community_detection.py
Last active Apr 29, 2020
python-igraph example
View community_detection.py
from igraph import *
import numpy as np
# Create the graph
vertices = [i for i in range(7)]
edges = [(0,2),(0,1),(0,3),(1,0),(1,2),(1,3),(2,0),(2,1),(2,3),(3,0),(3,1),(3,2),(2,4),(4,5),(4,6),(5,4),(5,6),(6,4),(6,5)]
g = Graph(vertex_attrs={"label":vertices}, edges=edges, directed=True)
visual_style = {}
@rbnvrw
rbnvrw / diagram.svg
Last active Oct 14, 2015
Autolayout graph nodes for interrelation diagram
View diagram.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.