This file contains 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
# copy html to clipboard | |
javascript:!function(e){var t=document.createElement("textarea"),o=document.getSelection();t.textContent=e,document.body.appendChild(t),o.removeAllRanges(),t.select(),document.execCommand("copy"),o.removeAllRanges(),document.body.removeChild(t),window.alert("Copied")}(document.querySelector('.yearly-aqi').innerHTML); | |
# download html file | |
javascript:!function () { var element = document.createElement('a'); var yearlyAqiElement = document.querySelector('.yearly-aqi'); var text = yearlyAqiElement.innerHTML; var city = window.location.href.match('https://aqicn.org/city/([A-Za-z]+)/')[1]; var specie = yearlyAqiElement.querySelector('.active-specie').innerText; var data = new Blob([text], { type: 'text/html' }); var url = window.URL.createObjectURL(data); element.setAttribute('href', url); element.setAttribute('download', (city + '_' + specie + '.html').toLowerCase()); element.style.display = 'none'; document.body.appendChild(element); element.click(); document.body.removeChild(element); } |
This file contains 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 tkinter import * | |
import time | |
class Rectangle: | |
objects = [] | |
@classmethod | |
def all_move_right(cls, event): | |
for obj in cls.objects: |
This file contains 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 pandas as pd | |
df = pd.read_excel('data.xlsx') | |
print(""" | |
Mode 1: Search with locus | |
Mode 2: Search with chr and pos | |
""") | |
mode = input('Input query mode: ') | |
if mode == '1': | |
query_locus = input('Input locus: ') |
This file contains 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 asyncio | |
import youtube_dl | |
async def progress(url): | |
print('Progressing: ', url) | |
await asyncio.sleep(1) | |
with youtube_dl.YoutubeDL({}) as ydl: | |
ydl.download([url]) | |
print('End: ', url) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 selenium import webdriver | |
import time | |
web = webdriver.Chrome() | |
web.implicitly_wait(10) | |
web.get(USE_YOUR_URL_HERE) | |
tmp = web.find_elements_by_xpath("//div[@class='section-review-review-content']") | |
while len(tmp) < int(TOTAL_NUMBER_OF_ITEMS): | |
web.execute_script(''' |
This file contains 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 zxing | |
reader = zxing.BarCodeReader() | |
barcode_text = reader.decode('./sample-image.png') | |
print(barcode_text) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.