Skip to content

Instantly share code, notes, and snippets.

View vasinkd's full-sized avatar

Kirill Vasin vasinkd

View GitHub Profile
kill $(ps aux | grep 'ssh -f -N -L' | awk '{print $2}')
@vasinkd
vasinkd / settings.json
Created July 16, 2020 18:13
My VSCode settings
{
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"editor.rulers": [
79
],
@vasinkd
vasinkd / updateable_cv.py
Created March 13, 2019 10:10
Updateable CountVectorizer
from sklearn.feature_extraction.text import CountVectorizer
import six
class UpdateableCountVectorizer(CountVectorizer):
def update(self, text, stop_words=[]):
require_sort = False
for word in text.split():
if (word not in self.vocabulary_) and \
(word not in stop_words):
self.vocabulary_[word] = word
@vasinkd
vasinkd / YaDisk.py
Last active September 19, 2018 17:50
I used this snippet to backup some files from my server to Yandex Disk
# coding: utf-8
#!/usr/bin/env python
#
# Based on https://github.com/TyVik/YaDiskClient
# Author: Kirill Vasin
import json
from requests import request
import os
disk_cred = ("user", "password")