Skip to content

Instantly share code, notes, and snippets.

View stefanthaler's full-sized avatar

Stefan Thaler stefanthaler

View GitHub Profile
@stefanthaler
stefanthaler / git-commit-macro
Created March 14, 2016 10:57
TexStudio macro that automatically commits the project folder, adds a commit message and pushes it to origin master
%SCRIPT
dialog = new UniversalInputDialog()
dialog.setWindowTitle("Git Commit")
dialog.add("[]", "Git Comment", "comment")
if (dialog.exec() != null) {
comment = dialog.get("comment")
buildManager.runCommand("git add .", editor.fileName())
buildManager.runCommand("git commit . -m \""+comment+"\"", editor.fileName())
buildManager.runCommand("git push origin master", editor.fileName())
}
@stefanthaler
stefanthaler / gp_to_svg
Created March 11, 2015 18:48
Small bash script that wraps a bash script around a python script to execute it like a "normal" program
#!/bin/bash
# copy
# create script in /usr/local/sbin/gp_to_svg
# run chmod +x on it
python /usr/local/sbin/gp_to_svg.py "$@"
@stefanthaler
stefanthaler / gp_to_svg.py
Created March 11, 2015 18:42
Small script that converts a gnuplot file to svg
#! /usr/bin/env python
"""
converts a gnuplot file to svg.
GnuPlot: http://people.duke.edu/~hpgavin/gnuplot.html
"""
import os, tempfile, sys
from tempfile import NamedTemporaryFile
from subprocess import call
from os import listdir
#! /usr/bin/env python
#generate and plot a ROC curve for a classifier using Orange (http://orange.biolab.si/)
#Source Code: https://github.com/biolab/orange/blob/master/Orange/evaluation/scoring.py
import Orange
learners = [Orange.classification.bayes.NaiveLearner(name="bayes"),
Orange.classification.tree.TreeLearner(name="tree"),
Orange.classification.svm.SVMLearnerEasy(name="easySVM")]
#split data to train and test set