Skip to content

Instantly share code, notes, and snippets.

@mitkof6
mitkof6 / youtube2mp3.py
Created August 31, 2023 19:34
Youtube to mp3 downloader with playlist option
#!/usr/bin/env python3
import re
import pytube
import argparse
parser = argparse.ArgumentParser(description="Youtube to MP3")
parser.add_argument("url")
parser.add_argument(
@mitkof6
mitkof6 / build_btkcore.sh
Last active December 14, 2020 18:50
BTKCore build
#!/usr/bin/env bash
# build BTKCore from source
set -xeuo pipefail
# install dependencies in case they are missing
# sudo apt-get --yes install git cmake swig python3-dev python3-pip
# pip3 install numpy --user
@mitkof6
mitkof6 / linux_build-opensim-core.sbatch
Created September 22, 2020 13:33
SLURM build opensim-core
#!/bin/bash
#SBATCH -J opensim-core_build
#SBATCH -J ./opensim-core_build
#SBATCH -o ./opensim-core_build.out
#SBATCH -e ./opensim-core_build.err
#SBATCH -N 1 # number of nodes
#SBATCH -n 38 # number of cores
#SBATCH --mem 28G # memory pool for all cores
#SBATCH --mail-user=dimitar.stanev@epfl.ch
@mitkof6
mitkof6 / linux_build-opensim-core.sh
Last active September 22, 2020 12:38
Automatic build of opensim-core on Ubuntu18.04
#!/usr/bin/env bash
set -xeuo pipefail
# install dependencies
# sudo apt-get --yes install git cmake cmake-curses-gui \
# freeglut3-dev libxi-dev libxmu-dev \
# liblapack-dev swig python-dev \
# openjdk-8-jdk
@mitkof6
mitkof6 / .sh
Created September 8, 2020 12:33
Copy SCONE's missing dynamic libraries
ldd sconestudio.exe | grep "=> /" | grep -v "WINDOWS" | grep -v "SCONE" | awk '{print $3}' | xargs -I '{}' cp -v '{}' .
@mitkof6
mitkof6 / opensim_sto_reader.py
Created November 18, 2017 21:15
A python function for reading OpenSim .sto files.
import os
def readMotionFile(filename):
""" Reads OpenSim .sto files.
Parameters
----------
filename: absolute path to the .sto file
@mitkof6
mitkof6 / PeriodicLockScreen.bat
Created September 24, 2017 11:20
PeriodicLockScreen: useful for eyes resting periods.
schtasks /create /tn "PeriodicLockScreen" /tr "rundll32.exe user32.dll, LockWorkStation" /sc HOURLY
@mitkof6
mitkof6 / delay.py
Last active July 31, 2017 13:42
a simple signal delay component for python
#!/usr/bin/env python
import numpy as np
import pylab as pl
import unittest
from scipy.interpolate import CubicSpline
class Delay:
"""Implements a signal delay.
@mitkof6
mitkof6 / ConstantAngleConstraint.h
Last active April 11, 2018 07:30
ConstantAngle constraint: a Simbody wrapper for OpenSim v4.0
/**
* This constraint consists of a single constraint equation that enforces that
* a unit vector v1 fixed to one body (the "base body") must maintain a fixed
* angle theta with respect to a unit vector v2 fixed on the other body (the
* "follower body"). This can be done with a single constraint equation as long
* as theta is sufficiently far away from 0 and +/-Pi (180 degrees), with the
* numerically best performance at theta=Pi/2 (90 degrees).
*/
class ConstantAngleConstraint : public OpenSim::Constraint {
OpenSim_DECLARE_CONCRETE_OBJECT(ConstantAngleConstraint, Constraint);