-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
# HGPA | ||
|
||
1982 - | ||
|
||
- [notes](notes/README.md) | ||
- [journal](journal/README.md) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# bookmarklets | ||
|
||
these things have been around for a long time! | ||
javascript has changed too! | ||
|
||
## copy a markdown link | ||
|
||
```js | ||
javascript:(async function copyMarkdownLink(s) { | ||
/* copy a markdown link with page title and href to the clipboard */ | ||
const mdLink = `[${document.title}](${window.location.href})`; | ||
const type = 'text/plain'; | ||
const blob = new Blob([mdLink], { type }); | ||
const data = [new ClipboardItem({ [type]: blob })]; | ||
await navigator.clipboard.write(data); | ||
})(); | ||
``` | ||
|
||
## copy a markdown citation | ||
|
||
i would like to create a citation using a format that i like. | ||
|
||
i can use page href, title and description, but many pages have additional data. | ||
some pages have JSON-LD tags and many more have open-graph meta tags. | ||
|
||
```js | ||
javascript:(async function copyMarkdownCitation(s) { | ||
/* copy a markdown link and page citation to the clipboard */ | ||
function meta(q) { | ||
const el = document.querySelector(`meta${q}`); | ||
return el && el.content || null; | ||
} | ||
const c = { | ||
title: meta('[property="og:title"]') || document.title, | ||
href: meta('[property="og:url"]') || window.location.href, | ||
author: meta('[name="author"]'), | ||
siteName: meta('[property="og:site_name"]') || window.location.hostname, | ||
description: meta('[name="description"]'), | ||
}; | ||
switch (window.location.hostname) { | ||
case 'en.wikipedia.org': | ||
c.title = document.title.split(' - ')[0]; | ||
c.author = 'Wikipedia'; | ||
break; | ||
case 'developer.mozilla.org': | ||
c.title = document.title.split(' | ')[0]; | ||
c.author = 'MDN'; | ||
default: | ||
break; | ||
} | ||
const mdLink = `[${c.title}](${c.href}). ${c.author}. ${c.siteName}.`; | ||
const type = 'text/plain'; | ||
const blob = new Blob([mdLink], { type }); | ||
const data = [new ClipboardItem({ [type]: blob })]; | ||
await navigator.clipboard.write(data); | ||
})(); | ||
``` | ||
|
||
## references | ||
|
||
[Bookmarklet](https://en.wikipedia.org/wiki/Bookmarklet). Wikipedia. en.wikipedia.org. | ||
|
||
[Bookmarklets are Dead…](https://medium.com/making-instapaper/bookmarklets-are-dead-d470d4bbb626). Brian Donohue. Medium. | ||
|
||
[Clipboard: write() method - Web APIs](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/write). MDN. developer.mozilla.org. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# jekyll | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# postmortem | ||
|
||
## references | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Super Nintendo Entertainment System (SNES) | ||
|
||
an absolute joy. | ||
|
||
## favorites | ||
|
||
- Actraiser | ||
- Chrono Trigger | ||
- Donkey Kong Country | ||
- Final Fantasy III (VI) | ||
- F-Zero | ||
- Mario Paint | ||
- NBA Jam | ||
- The Legend of the Mystical Ninja | ||
- The Legend of Zelda: A Link to the Past | ||
- StarFox | ||
- Street Fighter II | ||
- Super Bomberman | ||
- Super Mario Kart | ||
- Super Mario RPG | ||
- Super Mario World | ||
- UN Squadron | ||
|
||
## references | ||
|
||
[Random: Shinji Mikami Had To Ban The Resident Evil Devs From Playing Tetris Attack](https://www.nintendolife.com/news/2019/10/random_shinji_mikami_had_to_ban_the_resident_evil_devs_from_playing_tetris_attack). lol. |