Skip to content

Instantly share code, notes, and snippets.

View vasnake's full-sized avatar
🏠
Working from home

Valentin vasnake

🏠
Working from home
View GitHub Profile
@vasnake
vasnake / test_ex1.m
Created March 27, 2014 16:42
Stanford Machine Learning (Coursera). Unit Tests for Programming Exercises 1
%% UnitTest for Machine Learning Online Class - Exercise 1: Linear Regression
% Instructions
% ------------
%
% To test your code just type test_ex1 in command line
%% Initialization
clear ; close all; clc
@vasnake
vasnake / deluge.core.py.patch
Created January 15, 2014 14:10
Deluge 1.3.6 core/core.py patch for rutracker
--- core.py.orig 2014-01-14 19:37:27.287907299 +0400
+++ core.py 2014-01-14 19:45:17.137864423 +0400
@@ -87,14 +87,18 @@
# Note: All libtorrent python bindings to set plugins/extensions need to be disabled
# due to GIL issue. https://code.google.com/p/libtorrent/issues/detail?id=369
# Setting session flags to 1 enables all libtorrent default plugins
- self.session = lt.session(lt.fingerprint("DE", *version), flags=1)
+ self.session = lt.session(lt.fingerprint("DE", *version), flags=0)
+ self.session.add_extension("ut_pex")
+ self.session.add_extension("ut_metadata")
@vasnake
vasnake / 1 meapp.js
Last active December 31, 2015 23:51
This dojo module (meapp.js) will be rewrited to CoffeeScript. Practical example.
// deprecated. using meapp.coffee now
console.log('meapp enter');
var vappFactory = null;
define(
["dojo/_base/declare", "dojo/dom", 'dojo/has',
"vs/mpvlib"],
function(declare, dom, has, mpvlib) {
console.log('meapp dojo/define. define app classes');
@vasnake
vasnake / flask_gs.py
Created April 18, 2013 14:53
Flask Global Storage Extension. In Flask, it's possible to store data across many requests, but you must be aware of threading issues in that case.
#!/usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
# (c) Valik mailto:vasnake@gmail.com
r""" Global storage Flask extension.
In Flask, it's possible to store data across many requests.
But you must be aware of threading issues in that case.
Thanks to flask_sqlalchemy
https://github.com/mitsuhiko/flask-sqlalchemy/blob/master/flask_sqlalchemy.py