Skip to content

Instantly share code, notes, and snippets.

View vladimirmyshkovski's full-sized avatar
🎯
Focusing

Vladimir Myshkovski vladimirmyshkovski

🎯
Focusing
View GitHub Profile
@vladimirmyshkovski
vladimirmyshkovski / log.py
Created November 29, 2020 00:52 — forked from Bernix01/log.py
drf LogEntry viewset Mixin
'''
Extracted and modified from django-model-logging
It used it's own LogEntry model but since django
has it's own LogEntry maybe someone would want to
register in the same model instead of creating a
new one.
'''
from django.contrib.admin.models import LogEntry, ADDITION, CHANGE, ContentType, DELETION
from django.utils.translation import gettext as _
@vladimirmyshkovski
vladimirmyshkovski / idsentence.py
Created October 15, 2020 18:30 — forked from prschmid/idsentence.py
Implement a memorable ID string. The original idea for this comes from Asana where it is documented on their blog: http://blog.asana.com/2011/09/6-sad-squid-snuggle-softly/
"""Implement a memorable ID string.
The original idea for this comes from Asana where it is documented on their
blog:
http://blog.asana.com/2011/09/6-sad-squid-snuggle-softly/
There are other partial implementations of this and can be found here:
Node.js: https://github.com/linus/greg
Java: https://github.com/PerWiklander/IdentifierSentence
@vladimirmyshkovski
vladimirmyshkovski / UserInitials.vue
Created October 15, 2020 09:19 — forked from cb109/UserInitials.vue
Vuetify User Initials Avatar
<template>
<v-avatar v-if="user !== null"
:size="size"
:style="{'background-color': backgroundColor}">
<strong class="initials"
:style="{'color': fontColor,
'font-size': fontSize}">
{{ (user.first_name[0] + user.last_name[0]) || '?' }}
</strong>
@vladimirmyshkovski
vladimirmyshkovski / main.go
Created September 29, 2020 18:49 — forked from mcihad/main.go
Check standart django password in go language
package main
import (
"crypto/sha256"
"encoding/base64"
"fmt"
"golang.org/x/crypto/pbkdf2"
"strconv"
"strings"
)
@vladimirmyshkovski
vladimirmyshkovski / djargon2i.go
Created September 29, 2020 18:37 — forked from hanpama/djargon2i.go
Django Argon2PasswordHasher compatible password hasher in Golang
package djargon2i
import (
"crypto/rand"
"crypto/subtle"
"encoding/base64"
"errors"
"fmt"
"strings"
@vladimirmyshkovski
vladimirmyshkovski / timeago.js
Created September 19, 2020 10:05 — forked from pomber/timeago.js
Get a time ago human friendly string from a date (like dates in twitter).
const MINUTE = 60,
HOUR = MINUTE * 60,
DAY = HOUR * 24,
YEAR = DAY * 365;
function getTimeAgo(date) {
const secondsAgo = Math.round((+new Date() - date) / 1000);
if (secondsAgo < MINUTE) {
return secondsAgo + "s";
# -*- coding: utf-8 -*-
import scrapy
import json
class FreelancerComRuSpider(scrapy.Spider):
name = 'freelancer_com_ru'
allowed_domains = ['www.freelancer.com.ru']
iDisplayStart = 0
@vladimirmyshkovski
vladimirmyshkovski / freelansim.py
Created September 13, 2020 09:26
Freelansim Scrapy spider
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from scrapy.utils.markup import remove_tags
from freelance.scraper.scraper.items import OrderItem
class FreelansimSpider(CrawlSpider):
name = "freelansim"

Keybase proof

I hereby claim:

  • I am vladimirmyshkovski on github.
  • I am myshkovski (https://keybase.io/myshkovski) on keybase.
  • I have a public key ASAbLT2TKl_ilDTr_s4fS1tXQnYls32Za9T9L_yPgL94igo

To claim this, I am signing this object:

# Функция рассчитывающая ex dividend date
def _ex_dividend_date_func(self):
if self.ex_dividend_date:
return self.ex_dividend_date
if self.dps == 0 and self.record_date is not None \
or self.dps != 0 and self.record_date is None:
raise Exception('Record_date должен быть пустым, если dps = 0')
if self.dps == 0 or self.ticker.exchange is None: