Skip to content

Instantly share code, notes, and snippets.

View tolleiv's full-sized avatar

Tolleiv Nietsch tolleiv

  • Bare.ID Gmbh - an AOE Group company
  • Wiesbaden, Deutschland
View GitHub Profile
@tolleiv
tolleiv / restore_backup.sh
Created April 14, 2012 20:35
T3o restore_backup
#!/bin/bash
# Get absolute path to main directory
ABSPATH=$(cd "${0%/*}" 2>/dev/null; echo "${PWD}/${0##*/}")
SOURCE_DIR=`dirname "${ABSPATH}"`
#######################################################################
# Check for required binaries
if ! which mysql > /dev/null; then
@tolleiv
tolleiv / setup.sh
Created May 17, 2012 20:33
CMUSphinx (tutorial) setup
#!/bin/bash
# see http://cmusphinx.sourceforge.net/wiki/tutorialam
# see http://mnemonicplace.blogspot.de/2010/06/cmu-sphinx-error-wave2feat-error-while.html
sudo apt-get install build-essential autoconf libtool automake python-dev subversion bison vim
export PATH=/usr/local/bin:/usr/local/libexec/sphinxtrain:$PATH
export LD_LIBRARY_PATH=/usr/local/lib
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
mkdir ~/tutorial
cd ~/tutorial
@tolleiv
tolleiv / data.csv
Created June 24, 2012 17:57
http://kiwitobes.com/tree/decision_tree_example.txt turned into CSV to use with Google Predict
None slashdot USA 1 18
Premium google France 1 23
Basic digg USA 1 24
Basic kiwitobes France 1 23
Premium google UK 0 21
None (direct) New Zealand 0 12
Basic (direct) UK 0 21
Premium google USA 0 24
None slashdot France 1 19
None digg USA 0 18
@tolleiv
tolleiv / gist:3784342
Created September 25, 2012 20:48 — forked from entaroadun/gist:1653794
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation:

@tolleiv
tolleiv / grad.rb
Created September 27, 2012 20:31
Tiny stochastic gradient descent demo
# origin: http://sifter.org/~simon/journal/20061211.html
# further resource to get the context: http://www.stat.osu.edu/~dmsl/Koren_2009.pdf
samples = [[1,1,5.0], [1,2,3.0], [1,3,2.5],
[2,1,2.0], [2,2,2.5], [2,3,5.0], [2,4,2.0],
[3,1,2.5], [3,4,4.0], [3,5,4.5], [3,7,5.0],
[4,1,5.0], [4,3,3.0], [4,4,4.5], [4,6,4.0],
[5,1,4.0], [5,1,3.0], [5,1,2.0], [5,4,4.0], [5,5,3.5], [5,6,4.0]]
# avoid overfitting
@tolleiv
tolleiv / gist:3798722
Created September 28, 2012 08:51
Biased stochastic gradient descent demo
# origin: http://sifter.org/~simon/journal/20061211.html
# further resource to get the context: http://www.stat.osu.edu/~dmsl/Koren_2009.pdf
samples = [[1,1,5.0], [1,2,3.0], [1,3,2.5],
[2,1,2.0], [2,2,2.5], [2,3,5.0], [2,4,2.0],
[3,1,2.5], [3,4,4.0], [3,5,4.5], [3,7,5.0],
[4,1,5.0], [4,3,3.0], [4,4,4.5], [4,6,4.0],
[5,1,4.0], [5,1,3.0], [5,1,2.0], [5,4,4.0], [5,5,3.5], [5,6,4.0]]
# avoid overfitting
@tolleiv
tolleiv / capy.rb
Last active December 12, 2015 10:18
Inline headless capybara...
require 'capybara/dsl'
require 'capybara-webkit'
require 'headless'
include Capybara::DSL
Capybara.default_driver = :webkit
headless = Headless.new
headless.start
@tolleiv
tolleiv / guardme.sh
Last active December 14, 2015 18:19
PHPUnit setup with Composer, a sample project structure and a tiny sample test.
#!/bin/bash -e
# Use guard like described in http://erichogue.ca/2012/09/php/continuous-testing-in-php-with-guard/
# But without guard-phpunit as this isn't ready for the composer setup...
sudo aptitude install ruby1.9.3
sudo gem install guard guard-shell rb-inotify --no-rdoc --no-ri
cat > Guardfile << "EOF"
guard :shell do
@tolleiv
tolleiv / gist:5176269
Created March 16, 2013 12:59
Sample config to have a Nginx as reverse proxy with a fallback host included
upstream tracker {
server localhost:81;
server localhost:82 backup;
}
# HTTP server
server {
listen 80 default;
location / {
@tolleiv
tolleiv / .gitconfig
Last active December 15, 2015 08:19
My .gitconfig
[user]
name = Tolleiv Nietsch
email = tolleiv.nietsch@typo3.org
[alias]
st = status
ci = commit
br = branch
co = checkout
df = diff
lg = log -p