Skip to content

Instantly share code, notes, and snippets.

View arunsah's full-sized avatar

Arun arunsah

  • India
View GitHub Profile
@underground
underground / indexedDB.js
Created September 6, 2016 01:42
Very simple indexed DB wrapper class for javascript
export default class IndexedDB {
constructor(dbName, dbVersion, stores) {
this.db;
this.dbName = dbName;
this.dbVersion = dbVersion;
this.stores = stores;
}
openDB(callback=(()=>{})) {
if (!window.indexedDB) {
@BrianHung
BrianHung / Math.css
Last active October 30, 2022 04:58
Math NodeView for TipTap
.ProseMirror .Math {
display: contents;
}
.ProseMirror .Math .katex-editor {
display: inline;
}
.ProseMirror .Math .katex-render .katex {
font-size: 1em;
@BrianHung
BrianHung / MathBlock.css
Last active February 19, 2025 09:20
MathBlock NodeView for TipTap
.ProseMirror .MathBlock pre {
background: var(--default-back);
color: rgb(var(--default-font));
font-size: 0.8em;
display: flex;
padding: 1em;
}
.ProseMirror .MathBlock {
display: flex;
@BrianHung
BrianHung / SyntaxHighlight.js
Last active April 25, 2021 08:53
ProseMirror Plugin for CodeBlock Decorations
import { Plugin, PluginKey, Extension } from 'tiptap'
import { Decoration, DecorationSet } from 'prosemirror-view'
import { findBlockNodes } from 'prosemirror-utils'
import CodeMirror from 'codemirror/addon/runmode/runmode.node.js';
import "codemirror/mode/meta";
/*
* Global set of CodeMirror languages to dynamically import.
*/