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
| # https://stackoverflow.com/questions/32893773/how-to-git-log-with-date-time-and-file-names-in-one-line | |
| git log --pretty=%x0a%ci --name-only \ | |
| | awk ' | |
| /^$/ { dateline=!dateline; next } | |
| dateline { date=$0; next } | |
| !seen[$0]++ { print date,$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
| // https://jakearchibald.com/2021/encoding-data-for-post-requests/ | |
| function formToObject(formData) { | |
| return Object.fromEntries( | |
| [...new Set(formData.keys())] | |
| .map((key) => [key, formData.getAll(key)]), | |
| ); | |
| } | |
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
| sed -i '' '/line-with-text-to-delete/d' **/*.md |
This is an alternative to the Modern Script Loading tchnique, that doesn't need to wait for the load event.
This technique has been successfully tested down to IE9.
<!DOCTYPE html>
<html lang="en">
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
| :root { | |
| --ease-in-quad: cubic-bezier(0.55, 0.085, 0.68, 0.53); | |
| --ease-in-cubic: cubic-bezier(0.55, 0.055, 0.675, 0.19); | |
| --ease-in-quart: cubic-bezier(0.895, 0.03, 0.685, 0.22); | |
| --ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06); | |
| --ease-in-expo: cubic-bezier(0.95, 0.05, 0.795, 0.035); | |
| --ease-in-circ: cubic-bezier(0.6, 0.04, 0.98, 0.335); | |
| --ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94); | |
| --ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1); | |
| --ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1); |
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 isGenerator(target) { | |
| return target[Symbol.toStringTag] === 'GeneratorFunction'; | |
| } | |
| function isIterable(obj) { | |
| if (obj === null || obj === void 0) { | |
| return false; | |
| } | |
| if (typeof obj === 'string') { |
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 http = require('http'); | |
| const { once } = require('events'); | |
| class WebServer extends http.Server { | |
| async *[Symbol.asyncIterator]() { | |
| while (this.listening) { | |
| const [ req, res ] = await once(this, 'request'); | |
| yield { req, res }; | |
| } | |
| } |