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
// Url to test on: https://the-internet.herokuapp.com/tinymce | |
function selectorTest() { | |
const iframeDocument = document.querySelector('iframe').contentDocument | |
const textNode = iframeDocument.querySelector('#tinymce p') | |
const text = textNode.firstChild | |
let selection = iframeDocument.getSelection() | |
// Remove all existing ranges first | |
selection.removeAllRanges() |
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 { useCallback, useEffect, useState } from 'react'; | |
const Imanok = ({ callback }) => { | |
const expected = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65]; | |
const [keys, setKeys] = useState([]); | |
const onKeyDown = useCallback( | |
event => { | |
const newKeys = [...keys]; | |
newKeys.push(event.keyCode); |
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 base64 import b64encode as _b64encode, b64decode as _b64decode | |
from typing import Type | |
from django.db.models import Model | |
from django.shortcuts import get_object_or_404 | |
_encoding = "utf-8" | |
def decode_base64(value: str) -> str: |
OlderNewer