Skip to content

Instantly share code, notes, and snippets.

View nils-werner's full-sized avatar

Nils Werner nils-werner

View GitHub Profile
#!/bin/sh
SUBLIME="subl"
# We need to remove the stupid "file://" that Evince puts in front of the file name
# Notice the wild quoting: we need to interpolate $SUBLIME
# In the end, EDITORCMD should be of the form:
#
# f=%f; sublime-text "${f#file://}:%l"
#
# Contributor: Christian Thurau <christian DOT thurau AT iais DOT fraunhofer DOT de>
pkgname='python2-pymf'
pkgver=0.1.9
pkgrel=1
pkgdesc="Python Matrix Factorization (PyMF) is a module for several constrained/unconstrained matrix factorization (and related) methods"
url="http://code.google.com/p/pymf/"
arch=('any')
license=('GPL3')
depends=('python2' 'python2-cvxopt')
source=(https://pypi.python.org/packages/source/P/PyMF/PyMF-$pkgver.tar.gz pymf-$pkgver.patch)
@nils-werner
nils-werner / Makefile
Created October 16, 2013 19:03
LaTeX build system
MAKEFLAGS += -j1
LATEXFLAGS += -interaction=batchmode
TEXPATH += .:./lib//:
.PHONY: document beispiel desktop preview images clean cleanall
document: thesis.pdf cover.pdf back.pdf
cover: cover.pdf
@nils-werner
nils-werner / Audio.py
Created July 12, 2013 22:11
IPython Notebook Audio Viewer
from IPython.core.display import DisplayObject
import StringIO
import base64
import struct
import sys
class Audio(DisplayObject):
def __init__(self, data=None, rate=None, url=None, filename=None, autoplay=False):
if(data is not None):
buffer = StringIO.StringIO()
#!/usr/bin/env python
import numpy as np
import pyaudio
import scipy.io.wavfile as wav
import random
import time
import gc
from numpy import zeros, mat, matrix, sqrt, sin, arange, pi, exp, cos, array, dot, max, abs, int16, eye
@nils-werner
nils-werner / .bash_completion
Last active December 17, 2015 12:59
Autocompletion for Composer and Artisan
# Put this either in
#
# 1. a new file called ~/.bash_completion
# 2. your ~/.bashrc
#
_composer()
{
local cur=${COMP_WORDS[COMP_CWORD]}
local cmd=${COMP_WORDS[0]}
@nils-werner
nils-werner / audio_animation.py
Last active December 9, 2015 10:58
Matplotlib + PySoundCard
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from pysoundcard import Stream, continue_flag, complete_flag
number_of_blocks = 100
number_of_channels = 6
@nils-werner
nils-werner / config.txt
Created October 31, 2012 11:30
OpenELEC Raspi Config
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
# Inspired and partly copied from:
# http://youresuchageek.blogspot.fr/2012/09/howto-raspberry-pi-openelec-on.html
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" type="text/css" media="screen" href="http://symphony2.localhost/symphony/assets/css/symphony.css">
<link rel="stylesheet" type="text/css" media="screen" href="http://symphony2.localhost/symphony/assets/css/symphony.legacy.css">
<link rel="stylesheet" type="text/css" media="screen" href="http://symphony2.localhost/symphony/assets/css/symphony.grids.css">
<link rel="stylesheet" type="text/css" media="screen" href="http://symphony2.localhost/symphony/assets/css/symphony.frames.css">
<link rel="stylesheet" type="text/css" media="screen" href="http://symphony2.localhost/symphony/assets/css/symphony.forms.css">
<link rel="stylesheet" type="text/css" media="screen" href="http://symphony2.localhost/symphony/assets/css/symphony.tables.css">
<?php
Class extension_ownlogin extends Extension{
public function getSubscribedDelegates() {
return array(
array(
'page' => '/backend/',
'delegate' => 'AdminPagePreGenerate',
'callback' => 'changeLoginForm'