Lame-but-worked-for-me^TM approach to add your GitHub stars to your linkding instance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @section General Code Styles | |
| */ | |
| code, | |
| kbd, | |
| pre, | |
| samp { | |
| font-family: Menlo, Monaco, "Courier New", monospace; | |
| font-size: 0.875em; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(() => { | |
| const div = document.createElement('div'); | |
| div.classList.add("my-notes"); | |
| div.style.display = 'none'; | |
| div.style.backgroundColor = '#52614B'; | |
| div.style.position = 'fixed'; | |
| div.style.top = '0'; | |
| div.style.zIndex = '999'; | |
| div.style.maxWidth = '40rem'; | |
| div.style.maxHeight = '30vh'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Turn all HTML <a> elements into client side router links, no special framework-specific <Link> component necessary! | |
| // Example using the Next.js App Router. | |
| import { useRouter } from 'next/navigation'; | |
| import { useEffect } from 'react'; | |
| function useLinkHandler() { | |
| let router = useRouter(); | |
| useEffect(() => { | |
| let onClick = e => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function smmry(text) { | |
| var doc = []; | |
| var stoplist = [ | |
| "", | |
| "a", | |
| "about", | |
| "above", | |
| "above", | |
| "across", | |
| "after", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fetch = require('node-fetch'); | |
| const createHiddenField = (obj, fieldName, value) => { | |
| Object.defineProperty(obj, fieldName, { | |
| enumerable: false, | |
| writable: true, | |
| value: value, | |
| }); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import assert from 'node:assert/strict'; | |
| // Extended RegExp mode (flag /x) [1] via a template tag | |
| // | |
| // Quote: “While the x-mode flag can be used in a RegularExpressionLiteral, | |
| // it does not permit the use of LineTerminator in RegularExpressonLiteral. | |
| // For multi-line regular expressions you would need to use the RegExp | |
| // constructor.” | |
| // | |
| // The plan is to include this functionality in re-template-tag [2]. Then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // The actual API is documented at the end of this file | |
| /** | |
| * @see https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters | |
| */ | |
| const ansiConstants = { | |
| //----- Attributes ----- | |
| Normal: 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Functionality – when executed, these lines are copied to the clipboard: | |
| 1. The URL of the current web page. | |
| 2. The title of the current web page (as originally written) | |
| 3. The title of the current web page (converted to sentence case with a crude algorithm) | |
| 4. Optionally: The currently selected text (if any). | |
| Installation: Create a bookmark whose URL is the code below (including `javascript:{···}`): | |
| – Tested in Chrome and Safari. | |
| – Both browsers can handle URLs with multiple lines. |
The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.
This means you have the following choices:
- Use ESM yourself. (preferred)
Useimport foo from 'foo'instead ofconst foo = require('foo')to import the package. You also need to put"type": "module"in your package.json and more. Follow the below guide. - If the package is used in an async context, you could use
await import(…)from CommonJS instead ofrequire(…). - Stay on the existing version of the package until you can move to ESM.
NewerOlder