Skip to content

Instantly share code, notes, and snippets.

View Bortseb's full-sized avatar

Robert Best Bortseb

View GitHub Profile
@Bortseb
Bortseb / copy-to-clipboard-as-md-link-bookmarklet.md
Created March 1, 2019 10:40 — forked from mayosuke/copy-to-clipboard-as-md-link-bookmarklet.md
Create Bookmarklet (browser bookmark that executes Javsacript) to copy a browser window's page title and URL as markdown link style to a clipboard
@Bortseb
Bortseb / copy-to-clipboard-bookmarklet.md
Created March 1, 2019 10:40 — forked from brunohq/copy-to-clipboard-bookmarklet.md
Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard

Copy-to-clipboard Bookmarklet

Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard.

This is the base javascript:

(function (text) {
  var node = document.createElement('textarea')
  var selection = document.getSelection()
<?xml version="1.0" encoding="UTF-8"?><graphml xmlns="http://graphml.graphdrawing.org/xmlns">
<key attr.name="label" attr.type="string" for="node" id="label"/>
<key attr.name="Edge Label" attr.type="string" for="edge" id="edgelabel"/>
<key attr.name="weight" attr.type="double" for="edge" id="weight"/>
<key attr.name="r" attr.type="int" for="node" id="r"/>
<key attr.name="g" attr.type="int" for="node" id="g"/>
<key attr.name="b" attr.type="int" for="node" id="b"/>
<key attr.name="x" attr.type="float" for="node" id="x"/>
<key attr.name="y" attr.type="float" for="node" id="y"/>
<key attr.name="size" attr.type="float" for="node" id="size"/>

Keybase proof

I hereby claim:

  • I am bortseb on github.
  • I am robert_best (https://keybase.io/robert_best) on keybase.
  • I have a public key ASCvE7krfwgfz3a538um4Mhzsj4v0iKWz49YzsTcV9xs6wo

To claim this, I am signing this object: