Skip to content

Instantly share code, notes, and snippets.

@PalmerAL
PalmerAL / fontSpacingAdjustment.js
Created May 30, 2019 22:42
computes how much to adjust letter-spacing so that font-weight can be changed without affecting width
function getAdjustedFontSpacing () {
var sampleString = 'a b c d e f g h i j klmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=!@#$%^&*()_+'
var testElement = document.createElement('span')
testElement.style.visibility = 'hidden'
testElement.style.fontWeight = '400'
testElement.textContent = sampleString
document.body.appendChild(testElement)
// ==UserScript==
// @name Translate Page
// @match *
// @run-at context-menu
// ==/UserScript==
const TRANSLATE_TO_LANG = 'en'
function isVisible (el) {
// https://github.com/jquery/jquery/blob/305f193aa57014dc7d8fa0739a3fefd47166cd44/src/css/hiddenVisibleSelectors.js
@PalmerAL
PalmerAL / editor.js
Last active March 10, 2024 22:25
Min inline editor
// ==UserScript==
// @name Editor
// @match *
// @run-at document-start
// ==/UserScript==
function editorInit() {
//https://github.com/yabwe/medium-editor