Skip to content

Instantly share code, notes, and snippets.

View gnimmelf's full-sized avatar

Flemming hansen gnimmelf

  • @glimrende
  • Oslo, Norway
View GitHub Profile
@gnimmelf
gnimmelf / gist:f9aa963e094f2d9148a57addb0a8d6b0
Created February 15, 2022 21:12
Ghost 4 - Remove “Publish with Ghost” button on portal
/**
* Add this to site footer codeinjection
*/
// <script>
window.onload = () => {
let observer;
const targetNode = document.getElementById('ghost-portal-root');
observer = new MutationObserver((mutations) => {
@gnimmelf
gnimmelf / entityCodePoints.js
Created November 5, 2018 11:17
entityCodePoint to string
import characterEntities from 'character-entities-html4';
export const entityCodePoints = new Proxy(characterEntities, {
// http://xahlee.info/js/js_unicode_code_point.html
get: function(target, prop) {
console.log(target, prop)
return String.fromCodePoint(target[prop].codePointAt(0));
}
});
@gnimmelf
gnimmelf / rollup.config.js
Created February 12, 2018 22:18
Rollup config
import fs from 'fs';
import path from 'path';
// rollup.config.js
import builtins from 'rollup-plugin-node-builtins';
import globals from 'rollup-plugin-node-globals';
import babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import replace from 'rollup-plugin-replace';
import uglify from 'rollup-plugin-uglify';