Skip to content

Instantly share code, notes, and snippets.

@tobbe11
tobbe11 / nvim.md
Last active February 23, 2021 06:19
#!/bin/bash
declare -a menu ; declare -a cmds
menu+=(0 "Exit") ; cmds+=("exit 0")
menu+=(1 "uname") ; cmds+=("uname -a")
menu+=(2 "pwd") ; cmds+=("pwd")
ret=$(whiptail --title "My title" --menu "Make your choice:" 25 28 10 "${menu[@]}" 3>&1 1>&2 2>&3)
return ${cmds[${ret}]}
# rr() { $(${1:-./run.sh}); }
#!/bin/env python
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.widgets import LassoSelector, RectangleSelector, PolygonSelector
matplotlib.use("Qt5Agg") # This program works with Qt only
fig, ax1 = plt.subplots()
t = np.linspace(0, 10, 200)
@tobbe11
tobbe11 / CMakeLists.txt
Last active June 21, 2016 06:39
CMakeLists examples
cmake_minimum_required(VERSION 2.8.9)
project (openmp)
if (CMAKE_VERSION VERSION_LESS "3.1")
set (CMAKE_C_FLAGS "--std=c11 ${CMAKE_C_FLAGS}")
set (CMAKE_CXX_FLAGS "--std=c++11 ${CMAKE_CXX_FLAGS}")
else ()
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 11)
endif ()
@tobbe11
tobbe11 / mex_hello.c
Last active January 3, 2017 07:08
Matlab
#include "mex.h"
void
mexFunction (int nlhs, mxArray *plhs[],
int nrhs, const mxArray *prhs[])
{
mexPrintf ("Hello, World!\n");
mexPrintf ("I have %d inputs and %d outputs\n", nrhs, nlhs);
}
@tobbe11
tobbe11 / Makefile
Last active June 15, 2016 12:32
Simple Makefile for markdown
include H:\prj\inc.makefile
SOURCES = $(wildcard *.md)
TARGETS = $(patsubst %.pu,%.png,$(wildcard *.pu))
TARGETS += $(patsubst %.md,%.html,$(SOURCES))
DOCPATH = \\networkpath\doc
.PHONY: all clean install
all: ${TARGETS}
@tobbe11
tobbe11 / MSYS2.md
Last active June 15, 2016 13:05
MSYS2
@tobbe11
tobbe11 / .vimrc
Last active October 13, 2016 16:44
myvimrc
" https://github.com/junegunn/vim-plug && git
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
" https://github.com/monochromegane/the_platinum_searcher
" http://ctags.sourceforge.net/
"set makeprg=make
if has('win32')
source $VIMRUNTIME/mswin.vim
set guifont=Lucida_Console:h8:cANSI
set noshellslash
@tobbe11
tobbe11 / box1.txt
Last active June 15, 2016 12:38
My boxstarter scripts
#START http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/tobbe11/4fad5376e2feec8fc382/raw/box1.txt
#Or start http://boxstarter.org/package/spotify,vlc,firefox
#Special windowsy stuff. see http://boxstarter.org/WinConfig
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Enable-RemoteDesktop
Install-WindowsUpdate -AcceptEula
cinst geforce-experience