Skip to content

Instantly share code, notes, and snippets.

View tiendatleo's full-sized avatar

Nguyen Tien Dat tiendatleo

  • Ha Noi, Viet Nam.
View GitHub Profile
@jelleroorda
jelleroorda / TrailingNode.js
Last active July 1, 2023 16:14
Trailing node extension for TipTap 2
import { Extension } from '@tiptap/core'
import { PluginKey, Plugin } from 'prosemirror-state';
function nodeEqualsType({ types, node }) {
return (Array.isArray(types) && types.includes(node.type)) || node.type === types
}
/**
* Extension based on:
* - https://github.com/ueberdosis/tiptap/blob/v1/packages/tiptap-extensions/src/extensions/TrailingNode.js
@tranduongms1
tranduongms1 / quill-figure-with-caption.js
Last active December 12, 2023 14:04
Quill figure with caption, base on BlockEmbed
import Quill from 'quill';
const Module = Quill.import('core/module');
const BlockEmbed = Quill.import('blots/block/embed');
class ImageBlot extends BlockEmbed {
static blotName = 'image';
static tagName = ['figure', 'image'];
static create(value) {
@bmatcuk
bmatcuk / create-usb.sh
Created May 30, 2019 04:38
Creating a Bootable Windows USB from ISO on a Mac
# First, we need to find our device. BEFORE inserting your USB drive, run the
# following:
diskutil list
# This will output a bunch of info about all of the disk drives connected to
# your Mac. Each entry will have a header in the form "/dev/diskX", where X is
# some number starting at 0. Now, insert your USB drive and run the command
# again. You should see a new entry. Make note of the name (ie, /dev/diskX).
diskutil list