Skip to content

Instantly share code, notes, and snippets.

View BroJenuel's full-sized avatar
🏠
Working from home

Jenuel Oras Ganawed BroJenuel

🏠
Working from home
View GitHub Profile
@BroJenuel
BroJenuel / tiptapGetCursirPosition.js
Created June 7, 2023 02:07
This Gist is how to get the cursor position.
new Editor({
onTransaction: ({ state }) => {
console.log(state.selection.anchor)
},
})
@BroJenuel
BroJenuel / meta-tags.md
Created October 6, 2021 07:08 — forked from whitingx/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@BroJenuel
BroJenuel / presstab.js
Last active September 22, 2020 02:52
This is a function that will be called when pressing tab when writing inside a text area element in html. This will create 4 spaces just like a tab.
$('#textarea').keydown(function (e) {
var keyCode = e.keyCode || e.which;
if (keyCode === $.ui.keyCode.TAB) {
e.preventDefault();
const TAB_SIZE = 4;
// The one-liner that does the magic
document.execCommand('insertText', false, ' '.repeat(TAB_SIZE));