我想要一个AppleScript让我获取所选Messages.app对话/聊天的ID或类似内容,然后再使用AppleScript打开与此ID对应的正确消息对话/聊天.
使用Mail.app,我可以执行以下操作:
tell application "Mail"
set selectedMessages to selection
set theMessage to item 1 of selectedMessages
set messageid to message id of theMessage
-- Make URL (must use URL-encoded values for "<" and ">")
set urlText to "message://" & "%3c" & messageid & "%3e"
return urlText
end tell
但是使用Messages.app,就有了selection对象.
试图获取内容,the clipboard看看是否有任何可以使用的ID或值,但看起来剪贴板访问不像通过cocoa编程那样强大(你可以获得大量元数据和替代剪贴板内容).
双击对话,以便用它自己的窗口打开.试图获取此窗口的ID,然后稍后打开它.没工作.
我试图在Xcode的SceneKit编辑器中为我的模型烘焙光贴图纹理.但它不会根据我的紫外坐标生成纹理.有没有办法指定Xcode的纹理坐标?
我试着用一个简单的圆形盒子来做.这是结果:
我使用单个UV /纹理坐标源导入模型.它的预览看起来是正确的,如下所示.
当我尝试将光照贴图烘焙到纹理时,它会创建具有相应纹理的新UV /纹理坐标.但这是一个不同的纹理布局/纹理坐标(如下面的预览中所示).正如你所看到的,质量也不是那么好,你可以在侧面看到一个浅灰色方块.在真正的模型上,我正在测试它看起来更糟糕,一切看起来都被错误地放置了.
这就是纹理的样子.
那么有没有办法让它使用提供的UV /纹理坐标生成纹理?或者我应该如何使用它?
我在 SwiftUI macOS 应用程序中遇到侧边栏问题。当应用程序首次启动时,没有焦点,侧边栏中有一个额外的顶部填充,当窗口获得焦点时,它会折叠到正确的大小。这对我来说似乎是一个错误。有什么办法可以解决这个问题,还是我做错了什么?
\n正如您所看到的,在这两种情况下,“收件箱”和三个红绿灯点之间的间距是不同的。
\n\n这是侧边栏的代码:
\nNavigationView {\n List {\n Text("Inbox")\n \n Section(header: Text("All projects")) {\n ForEachStore(\n self.store.scope(state: { $0.projects }, action: AppAction.project(id:action:)), content: { projectStore in\n WithViewStore(projectStore) { projectViewStore in\n NavigationLink(\n destination: ProjectView(store: projectStore),\n label: {\n Text(projectViewStore.title)\n })\n }\n }\n )\n Spacer()\n }\n }.frame(minWidth: 160)\n .listStyle(SidebarListStyle())\n HStack { \n HStack {\n Button("\xe2\x88\x92") { viewStore.send(.decrementButtonTapped) }\n Text("\\(viewStore.count)")\n Button("+") { viewStore.send(.incrementButtonTapped) }\n \n }\n } \n }\nRun Code Online (Sandbox Code Playgroud)\n 我正在尝试使用本机 CSS 网格属性创建一个简单的 css 网格。它按我的意愿工作,但我想创建一个可以在网格中居中列的实用程序类。
有没有办法创建__centered实用程序类,以便我可以将其应用于中心列?我知道我可以在列之前添加空列 div,但我想要一个更干净的解决方案。
.l-wrap {
width: 100%;
max-width: 1196px;
margin: 0 auto;
}
.l-grid {
display: grid;
grid-gap: 52px;
grid-template-columns: repeat(6, 1fr);
background-color: orangered;
}
.l-grid--col {
grid-column: auto/span 6;
}
.l-grid--col-1 {
grid-column: auto/span 1;
background-color: lightblue;
}
.l-grid--col-2 {
grid-column: auto/span 2;
background-color: lightblue;
}
.l-grid--col-3 {
grid-column: auto/span 3;
background-color: lightblue;
}
.l-grid--col-4 {
grid-column: auto/span 4;
background-color: lightblue;
}
.l-grid--col-5 {
grid-column: auto/span 5;
background-color: lightblue;
}
.l-grid--col-6 {
grid-column: …Run Code Online (Sandbox Code Playgroud)我正在尝试使用 Docker 将 Craft CMS 部署到zeit/now。它在本地工作,但 zeit 的图像大小限制为100MB. 我的容器目前是176MB.
它是一个 Docker 镜像alpine,使用 Craft 所需的nginx和php模块,并使用多阶段构建来构建 Composer 组件,以减少构建工件的大小。
这是Dockerfile:
FROM zeit/wait-for:0.2 as wait\n\n# Build dependencies\nFROM composer:latest as vendor\n\nCOPY composer.json composer.json\nCOPY composer.lock composer.lock\n\nRUN composer install --ignore-platform-reqs --no-interaction --no-plugins --no-scripts --prefer-dist --no-dev\n\nFROM alpine:3.8\n\nLABEL maintainer="Eivind Mikael Lindbr\xc3\xa5ten <eivindml@icloud.com>"\nLABEL description="Minimal Craft CMS Container using nginx."\n\n# install nginx, php, and php extensions for Craft\nRUN apk add --no-cache \\\n bash \\\n …Run Code Online (Sandbox Code Playgroud) 我正在开发 RealityKit 应用程序,并使用 SwiftUI。
\n\n当然,RealityKit 视图在 SwiftUIPreviewProvider预览中不起作用。但我的问题是,即使是简单且完全隔离的 SwiftUI 视图也无法预览,因为PreviewProvider编译整个项目。
我的 SwiftUI View 类未以任何方式连接到 ARView 代码。如果我只需转到“文件”->“新建”并选择一个 SwiftUI 文件,然后尝试在画布中预览该文件就足够了(\xe2\x8c\xa5 + \xe2\x8c\x98 + \xe2\ x86\xb5),没有任何更改。然后它会给我那个错误。事实上我的中有任何代码.xcodeproj不受画布预览支持的代码,会出现错误。
我收到这样的错误:
\n\nValue of type \'ARView\' has no member \'installGestures\'\nRun Code Online (Sandbox Code Playgroud)\n\n我现在唯一的两个解决方案是 1)将文件复制到 Playground 并在那里进行实验,然后在完成后复制回来。2) 在处理视图之前,注释掉所有不受支持的 RealityKit 相关代码。
\n\n我试图在我的项目中引入代码分割,但我无法让它发挥作用。我得到的错误是:
我有一个 monorepo 设置,lib/其中包含我正在创建的整个 React 库的工作区,以及demo/仅导入该 React 模块并显示它的工作区,以用于测试目的。
我认为问题在于这两者如何交互以及块的输出或其他内容,但无法弄清楚。
我的文件是这样的:
var path = require('path')
module.exports = {
entry: {
maps: './src/index.js'
},
output: {
path: __dirname + '/dist',
filename: 'index.js',
library: 'Map',
libraryTarget: 'umd'
},
module: {
rules: [
{
test: /\.[s]?css$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
importLoaders: 1,
modules: {
localIdentName: "[name]__[local]___[hash:base64:5]",
}
}
},
'sass-loader'
],
include: /\.module\.[s]?css$/
},
{
test: /\.[s]?css$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
exclude: /\.module\.[s]?css$/
},
{ …Run Code Online (Sandbox Code Playgroud) 我有一个常规的 React 应用程序(CRA)。在应用程序的一部分中,我使用 Mapbox 来显示地图,并呈现一个弹出窗口,我需要传入一串要呈现的 html 内容。而不是传入原始 html,我仍然想使用 React 来呈现弹出窗口,所以我这样做:
const renderedContent = renderToString(
<Popup
port={port}
poiType={poiType}
activeView={activeView}
isPortsOnly={isPortsOnly}
locations={locations}
/>
)
Run Code Online (Sandbox Code Playgroud)
从呈现弹出组件中获取 html 字符串。这仍然是客户端,文档说renderToString()在客户端也可以用于这些用例。
new Popup()
.setLngLat(coordinates)
.setHTML(renderedContent)
.addTo(self.map)
Run Code Online (Sandbox Code Playgroud)
使用 html 字符串创建一个弹出窗口。
这按预期工作。现在我的问题是:我不想在 Popup 组件中使用 redux。两者都调度一个事件,并读取全局状态。我怎样才能做到这一点?我真的可以这样做吗?
如果我尝试仅redux在 Popup 组件中使用,则会收到以下错误消息:
Error: could not find react-redux context value; please ensure the component is wrapped in a <Provider>
我在网站上使用自定义字体。它有效,但看起来它们缓存的时间不够长,因为我经常得到 FOUT。有时一天多次,在生产中。我希望我可以将字体缓存更长的时间(或其他解决方案),以防止这种情况经常发生。
字体是这样预加载的_document.tsx:
<link
rel='preload'
as='font'
href='/fonts/Calibre-Regular.woff2'
type='font/woff2'
crossOrigin='anonymous'
/>
Run Code Online (Sandbox Code Playgroud)
然后_app.tsx像这样:
<script jsx>{`
@font-face {
font-family: 'Calibre';
font-display: swap;
src: url('/fonts/Calibre-Regular.woff2') format('woff2'),
url('/fonts/Calibre-Regular.woff') format('woff');
}
`}</script>
Run Code Online (Sandbox Code Playgroud)
我该如何改进?或者为字体设置更长的缓存时间?
I'm working on a iOS/macOS project where I'm using CoreData. It works fine, but it outputs enormous amounts of debugging info to the Console. This makes the Console unusable, since my print statements are buried in all the CoreData related stuff.
I have a pretty simple CoreData setup with fetching of some data, so these are not errors, just general event logs it seems. I have the same results on other projects I have used CoreData.
Any way to reduce/remove …
macos ×3
swift ×3
ios ×2
reactjs ×2
swiftui ×2
3d ×1
alpine-linux ×1
applescript ×1
arkit ×1
caching ×1
core-data ×1
craftcms ×1
css ×1
css-grid ×1
docker ×1
fonts ×1
grid-layout ×1
html ×1
javascript ×1
mapbox-gl-js ×1
message ×1
next.js ×1
nginx ×1
php ×1
react-redux ×1
realitykit ×1
redux ×1
rendering ×1
scenekit ×1
vercel ×1
webfonts ×1
webpack ×1
xcode ×1