Notifications这个网址里有某个仓库的通知无法被选中, 于是搜索并山风阁拿到了两行JavaScript,在FireFox上运行之后清掉了。 文章中描述的是Chrome的用法,之前我因为Feedbro被禁用搬到FireFox,所以这里重点说明如何在FireFox里使用。 把JavaScript片段贴到这里防止找不到: document.querySelector('.js-notifications-mark-all-actions').removeAttribute('hidden'); document.querySelector('.js-notifications-mark-all-actions form[action="/notifications/beta/archive"] button').removeAttribute('disabled'); 来到github的通知页面,在通知页面左侧,选中当前正在发送通知的幽灵仓库,这使得github的通知搜索栏里显示repo:开头的标签 点击“全选”(Select all) 按F12打开或从“工具”选项打开“开发者工具” 点击控制台,按Ctrl+B(或Command+B)打开切换到多行模式 尝试点击左边的栏目并粘贴代码,输入allow pasting确认粘贴代码 点击代码上方、控制台下方的运行按钮运行代码,这使得“全选”(Select all)之后的操作面板显示出来 点击Done,完成清除,等待刷新响应或手动刷新网页,该幽灵仓库应当不再产生通知圆点
基于MVVM模式手把手写出可测试性强的SwiftUI代码
用SwiftUI框架绘制视图 首先在Xcode里新建一个Swift Package包,要写UI库选择Library,git版本管理可以不勾,带SwiftTesting确保在Swift6的较新环境。 项目结构: ImmutableState ├── Package.swift ├── Sources │ └── ImmutableState │ └── ImmutableState.swift └── Tests └── ImmutableStateTests └── ImmutableStateTests.swift Package.swift(模板生成): let package = Package( name: "ImmutableState", products: [ // Products define the executables and libraries a package produces, making them visible to other packages. .library( name: "ImmutableState", targets: ["ImmutableState"]), ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. // Targets can depend on other targets in this package and products from dependencies. .target( name: "ImmutableState"), .testTarget( name: "ImmutableStateTests", dependencies: ["ImmutableState"] ), ] ) 上方展示了创建时的工程结构和模板生成Package.swift。 其次在ImmutableState.swift 旁边创建 ImmutableDemo 文件夹安放接下来的整套代码,也就在ImmutableDemo文件夹下使用 SwiftUIView 模板创建代码,然后右键struct的名称,refactor重构rename改名为 ImmutableView。 ...
HelloWorld
#Hello, wrold!