Skip to content

Instantly share code, notes, and snippets.

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

Andrii Oriekhov andriyor

🏠
Working from home
View GitHub Profile
@andriyor
andriyor / 0_reuse_code.js
Created March 31, 2017 17:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
import os
import json
import datetime
from flask import Flask, url_for, redirect, \
render_template, session, request
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager, login_required, login_user, \
logout_user, current_user, UserMixin
from requests_oauthlib import OAuth2Session
@andriyor
andriyor / cloudSettings
Last active August 21, 2017 20:30
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-08-21T20:29:59.817Z","extensionVersion":"v2.8.3"}
<form name="bk" action="#">
<div class="g-literature_20 g-prose_magic">
<p class="genre">
<a href="/g/201" class="genre" name="literature_20">Классическая проза ХX века</a>,
<a href="/g/203" class="genre" name="prose_magic">Магический реализм</a>
</p>
<img src="/img/znak.gif" alt="файл не оценен" title="файл не оценен" width="15px" height="15px" border="0" />
<input type="checkbox" id="201,203-" name="bchk513353"> -
<a href="/b/513353">Сто лет одиночества</a> [сборник] (пер.
<a href="/a/40884">Ростислав Леонидович Рыбкин</a>,
<form name="bk" action="#">
<div class="g-literature_20 g-prose_magic">
<p class="genre">
<a href="/g/201" class="genre" name="literature_20">Классическая проза ХX века</a>,
<a href="/g/203" class="genre" name="prose_magic">Магический реализм</a>
</p>
<img src="/img/znak.gif" alt="файл не оценен" title="файл не оценен" width="15px" height="15px" border="0"/>
<input type="checkbox" id="201,203-" name="bchk513353"/> -
<a href="/b/513353">Сто лет одиночества</a> [сборник] (пер.
<a href="/a/40884">Ростислав Леонидович Рыбкин</a>,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andriyor
andriyor / bot.py
Last active January 11, 2021 13:07
instantviw-new-item
import schedule
import time
import telebot
import requests
from bs4 import BeautifulSoup
from mongoengine import connect, Document, StringField
token = 'token'
bot = telebot.TeleBot(token)
from chalice import Chalice
from googletrans import Translator
app = Chalice(app_name='helloworld')
translator = Translator()
@app.route('/translate', methods=['POST'], cors=True)
def translate():
user_as_json = app.current_request.json_body
const puppeteer = require('puppeteer');
const scrape = async() => {
const browser = await puppeteer.launch({ headless: false, args: ['--start-maximized'] });
const page = await browser.newPage();
await page.setViewport({ width: 0, height: 0 });
await page.goto('https://www.bookdepository.com/');
await page.click(".sidebar .block-wrap a[href='/bestbooksever']");
await page.waitForSelector('.book-item');
import "es6-shim";
import "reflect-metadata";
import {deserializeArray, Expose, plainToClass, Transform, Type} from "class-transformer";
export function Default(defaultValue: any) {
return Transform((value: any) => (value !== null && value !== undefined ? value : defaultValue));
}
export class Pet {
name: string;