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 { createContext, createEffect, on, useContext, type JSXElement } from 'solid-js'; | |
import { createStore } from 'solid-js/store'; | |
import { render } from 'solid-js/web'; | |
// **** This is a complete, operational example of a store that includes custom methods. | |
// **** Copy-paste to https://playground.solidjs.com/ | |
// Store type (with custom methods) | |
export type State = ReturnType<typeof createAppStore>; |
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
setInterval(function deleteOne() { | |
const actions = document.querySelector("ytd-playlist-video-renderer button[aria-label='Меню действий']"); | |
actions.click(); | |
setTimeout(() => { | |
const icon = document.querySelector("path[d='M11 17H9V8h2v9zm4-9h-2v9h2V8zm4-4v1h-1v16H6V5H5V4h4V3h6v1h4zm-2 1H7v15h10V5z']"); | |
const remove = icon.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement; | |
remove.click(); | |
}, 10); | |
}, 20); |
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
// extract all emojis from https://*.slack.com/customize/emoji | |
// open devtools console and paste this code | |
// tested in google chrome | |
await getEmojis(); | |
async function getEmojis() { | |
const result = {}; | |
const allCount = parseInt(document.querySelector('.p-customize_emoji_wrapper__count').textContent); | |
const log = (s) => console.log('[sep] %c%s', 'background: #2f3640; color: #00a8ff; font-weight: bold; font-size: 14px; padding: 1px', s); |
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 { nanoid } from 'nanoid/non-secure'; | |
import { Autolog } from '../autolog'; | |
jest.mock('nanoid/non-secure'); | |
jest.mock('../autolog', () => { | |
const actual = jest.requireActual('../autolog'); | |
return { | |
__esModule: true, | |
...actual, |
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 psycopg2 | |
# 6. Сколько маршрутов обслуживают самолёты каждого типа? | |
query = """select ad.aircraft_code, count(distinct f.flight_no) | |
from aircrafts_data ad | |
left join flights f | |
using (aircraft_code) | |
group by ad.aircraft_code;""" | |
connection = psycopg2.connect( |