Skip to content

Instantly share code, notes, and snippets.

View StephanU's full-sized avatar

Stephan Uhle StephanU

View GitHub Profile
{
'mean_fit_time': array([ 0.0004015 , 0.00032099, 0.00032695, 0.00034134]),
'std_fit_time': array([ 3.56837565e-05, 5.58915169e-06, 6.80595845e-06, 1.92960365e-05]),
'mean_score_time': array([ 0.00066821, 0.00055901, 0.00057427, 0.0005753 ]),
'std_score_time': array([ 1.54544330e-04, 9.66763738e-06, 3.52108718e-05, 4.77900908e-05]),
'param_max_depth': masked_array(data = [3 3 4 4], mask = [False False False False], fill_value = ?),
'param_min_samples_leaf': masked_array(data = [1 2 1 2], mask = [False False False False], fill_value = ?),
'param_min_samples_split': masked_array(data = [2 2 2 2], mask = [False False False False], fill_value = ?),
'params': [
{'max_depth': 3, 'min_samples_leaf': 1, 'min_samples_split': 2},
@StephanU
StephanU / gist:6e0677f41e0da2a3334c
Created October 1, 2013 10:01
Couchdb Lucene index function
function(doc) {
if (!doc.type || doc.type !== 'calendarday') {
return null;
}
var result = new Array(),
freeTimeFrames = getFreeTimeFrames(doc);
for (var i = 0; i < freeTimeFrames.length; ++i) {
var ret = new Document();
@StephanU
StephanU / git-find-large-files.perl
Created April 18, 2013 09:16
Finds large files in the git history. Usage: "./git-find-large-files.perl 500k" finds files larger than 500k. This is from http://stackoverflow.com/questions/298314/find-files-in-git-repo-over-x-megabytes-that-dont-exist-in-head
#!/usr/bin/perl
use 5.008;
use strict;
use Memoize;
sub usage { die "usage: git-large-blob <size[b|k|m]> [<git-log arguments ...>]\n" }
@ARGV or usage();
my ( $max_size, $unit ) = ( shift =~ /^(\d+)([bkm]?)\z/ ) ? ( $1, $2 ) : usage();
@StephanU
StephanU / removeDocsFromCouchdb.js
Last active December 10, 2015 19:48
Remove docs from couchdb
var targetDB = "db";
$.couch.db(targetDB).allDocs({"success":function(docs){
for (var i = 0; i < docs.rows.length; ++i) {
var docId = docs.rows[i].id;
$.couch.db(targetDB).openDoc(docId, {"success":function(doc){
$.couch.db(targetDB).removeDoc(doc);
}});
}
}});
@StephanU
StephanU / hideHiddenFiles
Created January 12, 2012 01:28
Command to hide hidden files on mac
defaults write com.apple.finder AppleShowAllFiles -boolean false;killall Finder
@StephanU
StephanU / showHiddenFiles
Created January 12, 2012 01:27
Command to show hidden files on mac
defaults write com.apple.finder AppleShowAllFiles -boolean true;killall Finder
@StephanU
StephanU / work.sh
Created January 4, 2012 08:34
npm/proxy skript
#!/bin/sh
. ~/bin/proxy.sh
. <path to nvm>/nvm/nvm.sh
@StephanU
StephanU / proxy.sh
Created January 4, 2012 08:33
Proxy Skript
#!/bin/sh
proxy=<Proxy>
export http_proxy=http://$proxy
export https_proxy=https://$proxy
export ftp_proxy=ftp://$proxy
export socks_proxy=socks://$proxy