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
import { Project, Node } from 'ts-morph';
const project = new Project({
tsConfigFilePath: 'tsconfig.json'
});
const sourceFiles = project.getSourceFiles();
const toScssImports = (paths: string[]) => {
for (const path of paths) {
console.log(`@import ${path};`);
@andriyor
andriyor / scrapeCode.js
Created January 11, 2021 13:08
hl7-fhir-codes-table-parser
const puppeteer = require('puppeteer');
const fs = require("fs");
const path = require("path");
(async () => {
const browser = await puppeteer.launch({headless: false});
const page = await browser.newPage();
await page.goto('https://www.hl7.org/fhir/valueset-allergyintolerance-code.html');
const codes = await page.evaluate(() => {
import sys
import requests
from bs4 import BeautifulSoup
from github import Github
g = Github('login_or_token')
user_name, repo_name = sys.argv[1], sys.argv[2]
#!/usr/bin/env bash
DL_OUTPUT=$(youtube-dl "$1" --get-url);
URLS=($(echo "$DL_OUTPUT" | tr ',' '\n'))
snap run vlc "${URLS[0]}" --input-slave "${URLS[1]}"
from django.db import migrations
from dropbox import Dropbox
from dropbox.exceptions import ApiError
from dropbox.stone_validators import ValidationError
from realestate.images.models import Image
import environ
env = environ.Env(
DEBUG=(bool, False)
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "/certs"
stages:
- init
- verify
install dependencies:
stage: init
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;
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');
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
@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)