小编Rya*_*ard的帖子

谷歌云函数下载文件并重定向到bucket存储

我正在尝试使用 Node.js 中的谷歌云功能下载 wordpress 存储库的文件,然后将文件发送到谷歌云存储桶。我下载了 wordpress 文件,但无法写入谷歌存储桶。

function writeToBucket(jsonObject){

/*
 *  Google API authentication
 */

var gcs = require('@google-cloud/storage')({
         projectId: 'wp-media-cdn',
         keyFilename: 'wp-media-cdn-d9d7c61bfad9.json'
});

/*
 *  rename image file with image size, format: size X size imgName
 */

var pluginUrl = "https://downloads.wordpress.org/plugin/bbpress.2.5.14.zip";
    newPluginName = "bbpress";

/*
 *  Read image into stream, upload image to bucket
 */

var request = require('request');
var fs = require('fs'); //used for createWriteString()

var myBucket = gcs.bucket('test_buckyy'); //PUT BUCKET NAME HERE
var file = myBucket.file(nnewPluginName);

// …
Run Code Online (Sandbox Code Playgroud)

node.js google-cloud-storage google-cloud-platform google-cloud-functions

7
推荐指数
2
解决办法
7824
查看次数

Swift tableView缓慢和滚动滞后

我从json API中调用数据调用表视图填充但是非常慢并且在向下滚动时滞后如何加速表的加载.我是swift和xcode的新手,任何提示都会很有意思

import Foundation
import UIKit


class featuredViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {


@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var searchBar: UISearchBar!

// Array for JSON Data
var property: [featuredClass.property] = []
var imageArray = [String]()
var imageCollection = [[String]]()
var refreshControl: UIRefreshControl!


override func viewDidLoad() {
    super.viewDidLoad()
    self.getProperties()

    // Do any additional setup after loading the view, typically from a nib.
    refreshControl = UIRefreshControl()
    refreshControl.attributedTitle = NSAttributedString(string: "Pull to refresh")
    refreshControl.addTarget(self, action: #selector(featuredViewController.getProperties), for: UIControlEvents.valueChanged)
    tableView.addSubview(refreshControl)
}

override func …
Run Code Online (Sandbox Code Playgroud)

uitableview ios swift

3
推荐指数
1
解决办法
1318
查看次数

Google App Engine 通配符子域

我在谷歌应用引擎上运行了 Node JS 应用。

我已将自定义域链接到它:www.singlelisting.co

我需要通配符子域也链接到节点应用程序

例如:6.singlelisting.co 或 ns324.singlelisting.co

我在阅读谷歌开发者网站上的文档时运气不佳,我使用 cloudflare 进行 DNS 管理,并为所有谷歌 A 和 AAAA 记录添加了 * 记录。我相信问题是谷歌看到了子域。任何帮助将不胜感激

dns google-app-engine wildcard-subdomain cloudflare

2
推荐指数
1
解决办法
2033
查看次数