Skip to content

Instantly share code, notes, and snippets.

View ChristosT's full-sized avatar

Christos Tsolakis ChristosT

View GitHub Profile
@ChristosT
ChristosT / CMakeLists.txt
Last active May 28, 2022 06:33
Read triangular/tetrahedral mesh saved as vtk unstructured grid in python/ C++
cmake_minimum_required(VERSION 3.0)
project(ReadMesh)
find_package(VTK)
if(NOT VTK_FOUND)
message(FATAL "VTK not found")
endif()
include(${VTK_USE_FILE})
@ChristosT
ChristosT / convert_all_to_jpg.vba
Created June 3, 2019 14:57
Convert powerpoint slides to images in VBA
Sub convert_all_to_jpg()
' source https://stackoverflow.com/a/23956356
Dim oSl As Slide
Dim lWidthInPixels As Long
Dim lHeightInPixels As Long
lWidthInPixels = 2667
lHeightInPixels = 1500
For Each oSl In ActivePresentation.Slides
@ChristosT
ChristosT / gist:1899aa28ded418c82a3adb1a2f0031c2
Created May 3, 2019 14:23
Support CMAKE_CXX_STANDARD in older cmake versions
if (CMAKE_VERSION VERSION_LESS "3.1")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else ()
set (CMAKE_CXX_STANDARD 11)
endif ()
#source https://stackoverflow.com/a/31010221
@ChristosT
ChristosT / speedup_video_x2.sh
Created April 29, 2019 15:25
Speedup a video x2 using ffmpeg
#!/usr/bin/env bash
set -u
set -e
filename=$1
ext="${filename##*.}"
base=$(basename "${filename}" "${ext}")
new_filename="${base}"_x2${ext}
# change 0.5 to 0.25 for x4 speedup
ffmpeg -i "${filename}" -vf "setpts=0.5*PTS" "${new_filename}"
@ChristosT
ChristosT / convert_jupyter.py
Last active April 14, 2019 20:14
Convert jupyter notebooks to python scripts
#!/usr/bin/env python
# source https://stackoverflow.com/a/30776383
import sys,json
f = open(sys.argv[1], 'r') #input.ipynb
j = json.load(f)
of = open(sys.argv[2], 'w') #output.py
of.write("#!/usr/bin/env python\n")
if j["nbformat"] >=4:
@ChristosT
ChristosT / .tmux.conf
Created July 31, 2017 03:52
Sample tmux config file
# replace prefix with ctrl a
unbind-key C-b
set-option -g prefix C-a
bind-key C-a send-prefix
#set vi-type bindings
setw -g mode-keys vi
# increase history
set-option -g history-limit 6000
# utf8 is on
@ChristosT
ChristosT / .vimrc
Last active September 5, 2018 12:54
Sample VIM config file
" save and restore folds when a file is closed and re-opened
autocmd BufWinLeave *.* mkview
autocmd BufWinEnter *.* loadview
filetype plugin indent on
"Fortran indentation
let fortran_free_source=1
unlet! fortran_fixed_source
let fortran_fold=1
@ChristosT
ChristosT / README.md
Last active March 16, 2016 13:01
CS 725 Information Visualization - V7
@ChristosT
ChristosT / README.md
Last active March 13, 2016 02:10
State-Adjacency

If someone wants to travel through all the states he/she has to go through New-York since it is the connecting link between VT ,MA, CT, VI,RI ME,NH. ME is the only state that it is accesible accesible through only one state FL,SC,DC,WA are accesible only by two states, you can easily see then since they are on the boundary of the graph and connected only with two other states

This simple force-directed graph shows character co-occurence in Les Misérables. A physical simulation of charged particles and springs places related characters in closer proximity, while unrelated characters are farther apart. Layout algorithm inspired by Tim Dwyer and Thomas Jakobsen. Data based on character coappearence in Victor Hugo's Les Misérables, compiled by Donald Knuth.

@ChristosT
ChristosT / README.md
Last active February 22, 2016 14:30
CS 725 Information Visualization - VI5

Christos Tsolakis

eyes beat memory: animation vs. side-by-side view

The animation pushes the user to use his/her memory in order to compare the data for each company. On the other hand, on the stacked barcharts we have lower cognitive load and the comparison can be done directly. Moreover the use of the length as a channel (not area, since width is constant for all of bars) helps the user to perceive the actual data more accuratelly than the angle channel in the piecharts.