profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/silverwind/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

Mottie/GitHub-userscripts 1125

Userscripts to add functionality to GitHub

kevva/download 1118

Download and extract files

mafintosh/dns-packet 126

An abstract-encoding compliant module for encoding / decoding DNS packets

mafintosh/dns-socket 94

Make custom low-level DNS requests from node with retry support.

silverwind/caa 8

rfc6844-conform CAA record lookup and validation

silverwind/armhf-registry 7

Minimal Docker Registry image the ARM architecture

silverwind/as-networks 5

Get all CIDR networks contained in an autonomous system

KN4CK3R/gitea 1

Git with a cup of tea, painless self-hosted git service

6543-forks/gitea 0

Git with a cup of tea, painless self-hosted git service

jpraet/gitea 0

Git with a cup of tea, painless self-hosted git service

PullRequestReviewEvent

Pull request review commentgo-gitea/gitea

Avatar refactor, move avatar code from `models` to `models.avatars`, remove duplicated code

 package user  import (-	"errors"-	"net/url"-	"path"-	"strconv" 	"strings"+	"time"  	"code.gitea.io/gitea/models"+	"code.gitea.io/gitea/models/avatars" 	"code.gitea.io/gitea/modules/context" 	"code.gitea.io/gitea/modules/httpcache"-	"code.gitea.io/gitea/modules/log"-	"code.gitea.io/gitea/modules/setting" )  func cacheableRedirect(ctx *context.Context, location string) {-	ctx.Resp.Header().Set("Cache-Control", httpcache.GetCacheControl())+	// here we should not use `setting.StaticCacheTime`, it is pretty long (default: 6 hours)+	// we must make sure the redirection cache time is short enough, otherwise a user won't see the updated avatar in 6 hours+	// it's OK to make the cache time short, it is only a redirection, and doesn't cost much to make a new request+	httpcache.AddCacheControlToHeader(ctx.Resp.Header(), time.Minute)

Yes, we should get rid of this redirect, at least for the cases where the URL can be synchonously obtained, which is certainly possible for Gravatar (but not for some other federated services, IIRC).

So Gravatar should just render img src="<gravatar-url>". Is this the case after this refactor?

wxiaoguang

comment created time in 16 hours

Pull request review commentgo-gitea/gitea

Avatar refactor, move avatar code from `models` to `models.avatars`, remove duplicated code

 package user  import (-	"errors"-	"net/url"-	"path"-	"strconv" 	"strings"+	"time"  	"code.gitea.io/gitea/models"+	"code.gitea.io/gitea/models/avatars" 	"code.gitea.io/gitea/modules/context" 	"code.gitea.io/gitea/modules/httpcache"-	"code.gitea.io/gitea/modules/log"-	"code.gitea.io/gitea/modules/setting" )  func cacheableRedirect(ctx *context.Context, location string) {-	ctx.Resp.Header().Set("Cache-Control", httpcache.GetCacheControl())+	// here we should not use `setting.StaticCacheTime`, it is pretty long (default: 6 hours)+	// we must make sure the redirection cache time is short enough, otherwise a user won't see the updated avatar in 6 hours+	// it's OK to make the cache time short, it is only a redirection, and doesn't cost much to make a new request+	httpcache.AddCacheControlToHeader(ctx.Resp.Header(), time.Minute)

I don't agree to lowering this because it creates different caching behaviour of local vs. remote (Gravatar) avatars. Local avatars don't hit this code path so are still subject to setting.StaticCacheTime. I think we should either lower the default value or introduce a new config option for avatar cache time.

wxiaoguang

comment created time in 17 hours

PullRequestReviewEvent

created tagStylishThemes/GitHub-Dark

tagv5.0.25

:octocat: Dark GitHub style

created time in 20 hours

push eventStylishThemes/GitHub-Dark

github-actions[bot]

commit sha 20779dbef737efa976dba8652e3377ac16a27af3

automated regeneration

view details

github-actions[bot]

commit sha 80e5363677c0171a752115250cd3f6dd5b575f0e

v5.0.25 * automated regeneration (github-actions[bot])

view details

push time in 20 hours

issue commentsindresorhus/eslint-plugin-unicorn

Rule proposal: Require extension for relative imports and re-exports

An autofix for this rule would also be awesome. import/extensions doesn't provide one, making it very tedious to manually refactor big projects from ./file to ./file.js imports.

sindresorhus

comment created time in 20 hours

Pull request review commentgo-gitea/gitea

Re-allow clipboard copy on non-https sites

 function onError(btn) {   btn.dataset.content = btn.dataset.original; } +/** Use the document.execCommand to copy the value to clipboard */+function fallbackCopyViaSelect(elem) {+  elem.select();++  // if unsecure (not https), there is no navigator.clipboard, but we can still use document.execCommand to copy to clipboard+  // it's also fine if we don't test it exists because of the try statement+  return document.execCommand('copy');+}+/**+ * Fallback to use if navigator.clipboard doesn't exist.+ * Achieved via creating a temporary textarea element, selecting the text, and using document.execCommand.+ */+function fallbackCopyToClipboard(text) {+  const tempTextArea = document.createElement('textarea');+  tempTextArea.value = text;++  // avoid scrolling+  tempTextArea.style.top = 0;+  tempTextArea.style.left = 0;+  tempTextArea.style.position = 'fixed';++  document.body.appendChild(tempTextArea);++  const success = fallbackCopyViaSelect(tempTextArea);++  document.body.removeChild(tempTextArea);++  return success;+}

That's fine. I just want to avoid visible UX interactions like inputElement.select(), so using the temporary textarea is preferred.

tech-meppem

comment created time in a day

PullRequestReviewEvent

Pull request review commentgo-gitea/gitea

Re-allow clipboard copy on non-https sites

 function onError(btn) {   btn.dataset.content = btn.dataset.original; } +/** Use the document.execCommand to copy the value to clipboard */+function fallbackCopyViaSelect(elem) {+  elem.select();++  // if unsecure (not https), there is no navigator.clipboard, but we can still use document.execCommand to copy to clipboard+  // it's also fine if we don't test it exists because of the try statement+  return document.execCommand('copy');+}+/**+ * Fallback to use if navigator.clipboard doesn't exist.+ * Achieved via creating a temporary textarea element, selecting the text, and using document.execCommand.+ */+function fallbackCopyToClipboard(text) {+  const tempTextArea = document.createElement('textarea');+  tempTextArea.value = text;++  // avoid scrolling+  tempTextArea.style.top = 0;+  tempTextArea.style.left = 0;+  tempTextArea.style.position = 'fixed';++  document.body.appendChild(tempTextArea);++  const success = fallbackCopyViaSelect(tempTextArea);++  document.body.removeChild(tempTextArea);++  return success;+}

Thought I'd argue that we sometimes will want to copy stuff the the clipboard that is not contained in a <input>, so I think it'd be better to only use this method with a temporary <textarea> to copy arbitrary text and remove the document.execCommand variant (it is deprecated API anyways).

tech-meppem

comment created time in a day

PullRequestReviewEvent

Pull request review commentgo-gitea/gitea

Re-allow clipboard copy on non-https sites

 function onError(btn) {   btn.dataset.content = btn.dataset.original; } +/** Use the document.execCommand to copy the value to clipboard */+function fallbackCopyViaSelect(elem) {+  elem.select();++  // if unsecure (not https), there is no navigator.clipboard, but we can still use document.execCommand to copy to clipboard+  // it's also fine if we don't test it exists because of the try statement+  return document.execCommand('copy');+}+/**+ * Fallback to use if navigator.clipboard doesn't exist.+ * Achieved via creating a temporary textarea element, selecting the text, and using document.execCommand.+ */+function fallbackCopyToClipboard(text) {+  const tempTextArea = document.createElement('textarea');+  tempTextArea.value = text;++  // avoid scrolling+  tempTextArea.style.top = 0;+  tempTextArea.style.left = 0;+  tempTextArea.style.position = 'fixed';++  document.body.appendChild(tempTextArea);++  const success = fallbackCopyViaSelect(tempTextArea);++  document.body.removeChild(tempTextArea);++  return success;+}

I don't think this fallback is necessary for the browsers we support. I think all of them can do document.execCommand.

tech-meppem

comment created time in a day

PullRequestReviewEvent

Pull request review commentgo-gitea/gitea

Re-allow clipboard copy on non-https sites

 export default async function initClipboard() {       if (!text) return;        try {-        await navigator.clipboard.writeText(text);-        onSuccess(btn);+        if (navigator.clipboard && window.isSecureContext) {

Wouldn't navigator.clipboard.writeText throw an error in case this clipboard-write is being denied? It would be better to catch and handle such a error if it exists.

I think I recall copy works on non-secure origin http://localhost, so I think isSecureContext is not the only condition that a browser checks.

tech-meppem

comment created time in a day

PullRequestReviewEvent

Pull request review commentvercel/ncc

Remove all comments during minification

 function ncc (             keep_classnames: true,             keep_fnames: true           },+          format: {+            comments: false+          },

While I think code that relies on function.toString is fundamentally flawed, I guess a option could be introduced on whether to retain such comments.

Or more maybe even more generally, the minifier options could be exposed on the Node.js API, e.g. property minfierOptions that is then deep-merged into the static configuration.

silverwind

comment created time in a day

PullRequestReviewEvent

push eventStylishThemes/GitHub-Dark

github-actions[bot]

commit sha 0c5545ceb62972bc4eb597f6c203a9b4677197e4

automated regeneration

view details

github-actions[bot]

commit sha bbdb54158c5f784ba936be43d57adf38f944dca7

v5.0.24 * automated regeneration (github-actions[bot])

view details

push time in 2 days

created tagStylishThemes/GitHub-Dark

tagv5.0.24

:octocat: Dark GitHub style

created time in 2 days

issue commentMikeBishop/dns-alt-svc

Clarify whether SvcParams is mandatory or optional

Actually this seems to be clarified in section 1.2 which I skipped over earlier.

silverwind

comment created time in 2 days

issue closedMikeBishop/dns-alt-svc

Clarify whether SvcParams is mandatory or optional

I would like to know whether a record without any SvcParams should be considered valid. Reading through sections 2, it is not immediately clear whether SvcParams is mandatory or optional. Section 2 says

SVCB RRs are extensible by a list of SvcParams

The word "extensible" implies to me that SvcParams is optional but section 2.1 list it like this:

Name TTL IN SVCB SvcPriority TargetName SvcParams

There are no optional ABNF sequences ([]) in this declaration, which makes it seem as if at least one SvcParamKey is required.

closed time in 2 days

silverwind

issue openedMikeBishop/dns-alt-svc

Clarify whether SvcParams is mandatory or optional

I would like to know whether a record without any SvcParams should be considered valid. Reading through sections 2, it is not immediately clear whether SvcParams is mandatory or optional. Section 2 says

SVCB RRs are extensible by a list of SvcParams

The word "extensible" implies to me that SvcParams is optional but section 2.1 list it like this:

Name TTL IN SVCB SvcPriority TargetName SvcParams

There are no optional ABNF sequences ([]) in this declaration, which makes it seem as if at least one SvcParamKey is required.

created time in 2 days

push eventsilverwind/eslint-config-silverwind

silverwind

commit sha b035f6915f6b696e92dfb30970f290f379485593

41.0.0 * update deps, add new rules (silverwind) * limit import/no-cycle depth (silverwind)

view details

push time in 2 days

created tagsilverwind/eslint-config-silverwind

tag41.0.0

Personal ESLint configuration

created time in 2 days

push eventsilverwind/eslint-config-silverwind

silverwind

commit sha daf6aa64f76405f3476104e235fe10f0e0797456

update deps, add new rules

view details

push time in 2 days

push eventsilverwind/eslint-config-silverwind

silverwind

commit sha a1e87961a4944b01dc66d66d85c284b4f3b026a4

limit import/no-cycle depth

view details

push time in 2 days

issue openedvuejs/vue-loader

npm package metadata missing for 16.0.0 and above

Version

16.5.0

Reproduction link

https://none/

Steps to reproduce

Since v16.0.0, it appears that package.json metadata is no longer being included in the vue-loader npm package and https://www.npmjs.com/package/vue-loader also shows no link back to the repo because of this:

$ curl -s https://registry.npmjs.org/vue-loader | jq '.versions["15.9.8"].repository'
{
  "type": "git",
  "url": "git+https://github.com/vuejs/vue-loader.git"
}
$ curl -s https://registry.npmjs.org/vue-loader | jq '.versions["16.0.0"].repository'
null
$ curl -s https://registry.npmjs.org/vue-loader | jq '.versions["16.5.0"].repository'
null

What is expected?

metadata to be present in package.json

What is actually happening?

no metadata present

<!-- generated by vue-issues. DO NOT REMOVE -->

created time in 2 days

issue openedvuejs/vue-loader

npm package metadata missing for 16.0.0 and above

Since v16.0.0, it appears that package.json metadata is no longer being included in the npm package and https://www.npmjs.com/package/vue-loader also shows no link back to the repo because of this:

$ curl -s https://registry.npmjs.org/vue-loader | jq '.versions["15.9.8"].repository'
{
  "type": "git",
  "url": "git+https://github.com/vuejs/vue-loader.git"
}
$ curl -s https://registry.npmjs.org/vue-loader | jq '.versions["16.0.0"].repository'
null
$ curl -s https://registry.npmjs.org/vue-loader | jq '.versions["16.5.0"].repository'
null

created time in 2 days

issue openedvuejs/vue-loader

npm package metadata missing for 16.0.0 and above

Since v16.0.0, it appears that package.json metadata is no longer being published and https://www.npmjs.com/package/vue-loader also shows no link back to the repo because of this:

$ curl -s https://registry.npmjs.org/vue-loader | jq '.versions["15.9.8"].repository'
{
  "type": "git",
  "url": "git+https://github.com/vuejs/vue-loader.git"
}
$ curl -s https://registry.npmjs.org/vue-loader | jq '.versions["16.0.0"].repository'
null
$ curl -s https://registry.npmjs.org/vue-loader | jq '.versions["16.5.0"].repository'
null

created time in 2 days

startedtesting-library/react-testing-library

started time in 2 days