Skip to content

Instantly share code, notes, and snippets.

:octocat:
Edit status

user skar404

:octocat:
Edit status
Block or report user

Report or block skar404

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@skar404
skar404 / app.py
Last active Feb 4, 2020
group by
View app.py
from base64 import b64encode
from json import dumps, loads, JSONEncoder
import pickle
class AllTypeJSONEncoder(JSONEncoder):
def default(self, obj):
if isinstance(obj, (list, dict, str, int, float, bool, type(None))):
return super().default(obj)
elif isinstance(obj, (set, )):
@skar404
skar404 / README.md
Last active Aug 28, 2019
Test work
View README.md
  1. Использовать - библиотеку Flask https://palletsprojects.com/p/flask/
  2. Для наполнения БД данными:
    1. написать модель (таблицу) на SQLAlchemy https://flask-sqlalchemy.palletsprojects.com/en/2.x/quickstart/ с полями id (int), name (string), created_at(datetime), active(bool) name - имя студента created_at - дата создаиня archived - если true тогда запись удалена
  3. Написать API методы (получаем запрос, обращаемся к БД, отдаём результат):
    1. GET /students
    2. POST /students
View test.sh
echo "Hello world"
View install-docker.sh
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
@skar404
skar404 / serializers.py
Last active Sep 4, 2018
test serializers
View serializers.py
class TestSerializers(serializers.Serializer):
type = serializers.CharField(max_length=200)
object = serializers.DictField(
lead_id=serializers.IntegerField(),
form_name=serializers.CharField(max_length=200),
answers=serializers.ListField(
serializers.DictField(
lead_id=serializers.IntegerField(),
key=serializers.CharField(max_length=200)
@skar404
skar404 / install.sh
Created Jul 31, 2018
Install docker in Ubuntu
View install.sh
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@skar404
skar404 / test.log
Created Jun 14, 2018
pydub, test fail
View test.log
/Users/users/project/pydub/venv/bin/python /Users/users/project/pydub/test/test.py
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.................EEEE..........
======================================================================
ERROR: test_192khz_audio (__main__.AudioSegmentTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/users/project/pydub/test/test.py", line 187, in setUp
test1 = AudioSegment.from_mp3(os.path.join(data_dir, 'test1.mp3'))
File "/Users/users/project/pydub/test/pydub/audio_segment.py", line 703, in from_mp3
return cls.from_file(file, 'mp3', parameters)
@skar404
skar404 / docker-compose-coreos.sh
Last active Jun 1, 2018
Install docker-compose in CoreOS
View docker-compose-coreos.sh
#!/bin/bash
sudo su -
VERSION=1.21.2
mkdir -p /opt/bin
curl -L https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-`uname -s`-`uname -m` > /opt/bin/docker-compose
chmod +x /opt/bin/docker-compose
docker-compose --version
View keybase.md

Keybase proof

I hereby claim:

  • I am skar404 on github.
  • I am myusername (https://keybase.io/myusername) on keybase.
  • I have a public key ASDPlCU20erDh5nsd-jlVD8MKDqS1R3fll2F0_uDWUlp0Qo

To claim this, I am signing this object:

View vk_8.py
# -*- coding: utf-8 -*-
import vk_api
def main():
login, password = 'user@user.ru', '12345678'
vk_session = vk_api.VkApi(login, password)
try:
vk_session.authorization()
You can’t perform that action at this time.