This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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};`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(() => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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]}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variables: | |
DOCKER_DRIVER: overlay2 | |
DOCKER_TLS_CERTDIR: "/certs" | |
stages: | |
- init | |
- verify | |
install dependencies: | |
stage: init |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import schedule | |
import time | |
import telebot | |
import requests | |
from bs4 import BeautifulSoup | |
from mongoengine import connect, Document, StringField | |
token = 'token' | |
bot = telebot.TeleBot(token) |
NewerOlder