Skip to content

Instantly share code, notes, and snippets.

@dfkaye
Created August 2, 2023 19:28
Show Gist options
  • Save dfkaye/eded4b390075425001cf23622576ac4c to your computer and use it in GitHub Desktop.
Save dfkaye/eded4b390075425001cf23622576ac4c to your computer and use it in GitHub Desktop.
tweet, "one line of code"
// 22 July 2023
// one line tweet
// https://twitter.com/dfkaye/status/1682924372775038979
// response to @johanvinet
// "PROGRAMMERS you can only use one line of code to convince people to follow
// you"
// Of course no new followers...
console.log(
`%c${$('body').innerHTML = await (async v => v)(
'about dfkaye'.link('https://dfkaye.com/about')
)}`,
`background:#efe; color:#05aa50; font:italic 1.2em/2 consolas;`
);
// Prints <a href="https://dfkaye.com/about">about dfkaye</a> with color, font,
// and other styleSheet rules.
// The async closure returns a function that returns a promise when called,
// strictly for illustration (i.e., "yes, you can do that"). Here we invoke it
// with the anchor or link method on the string and await its value (a string),
// then replace the body element's HTML with the new HTML.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment