Skip to content

Instantly share code, notes, and snippets.

Avatar

Kirill Vasin vasinkd

View GitHub Profile
@vasinkd
vasinkd / settings.json
Created Jul 16, 2020
My VSCode settings
View settings.json
{
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"editor.rulers": [
79
],
@vasinkd
vasinkd / updateable_cv.py
Created Mar 13, 2019
Updateable CountVectorizer
View updateable_cv.py
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 Sep 19, 2018
I used this snippet to backup some files from my server to Yandex Disk
View YaDisk.py
# 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")