official_dulin

Results 152 issues of official_dulin

# PostgreSQL使用COPY命令复制CSV文件数据报错 ### 前言 阅读此文章需要熟练掌握以下技术: - PostgreSQL 9.6 - Knex.js - SQL查询构建器 - Docker/Docker compose - 容器/容器编排 - Node.js - TypeScript - SQL - 结构化查询语言 - Google Adwords (Optional) ###...

技术文档
编程
Node.js
PostgreSQL
Docker

![chrome-extension-debug-issue](https://cloud.githubusercontent.com/assets/17866683/24733509/ce6bbd3c-1aaa-11e7-8a66-e939b6771188.png) **现象:** 在自己的程序中,有这样一条语句: ```js document.addEventListener('click', this.handleClick, false); ``` 然后调试时,控制台报错: ``` Uncaught TypeError: Cannot read property 'nodeName' of null at HTMLDocument.onMouseClick (content.js:139) ``` 起初疑惑,我当前调试的程序,并没有涉及到`content.js`文件,点击该文件名,可以在`Sources`下打开该文件,发现这文件里面的代码根本不是我项目中。打开`Sources`侧边栏,找到报错的原因了,这个脚本是“迅雷下载支持”这个chrome扩展程序的。 这个脚本有这样一条语句: ```js document.addEventListener("click", onMouseClick, false); ``` 我的程序和这个扩展程序都在`document`上绑定了`click`事件。...

chrome

### 问题 使用gcloud sdk获取compute engine instance的描述信息,报错如下: ![image](https://user-images.githubusercontent.com/17866683/57565657-30d52400-73f4-11e9-9c39-04f680d947d1.png) ```zsh ☁ mrdulin gcloud compute instances describe ssr ERROR: (gcloud.compute.instances.describe) This may be due to network connectivity issues. Please check your network settings,...

技术文档
OSX
terminal
软件工具
GCP

## bower install 功能: 安装项目依赖的包 语法: ```bat $ bower install [] $ bower install [ ..] [] ``` 端点(endpoint)可以是如下形式: * `` * `#` * `=#` __说明:__ * ``可以是一个包的URL链接地址,本地地址或者注册的包名 * ``是包的有效版本号范围中的一个值...

bower

今天一大早起来发现GitHub的一个的仓库被删了,这个仓库存储了从网络上“非法”下载的编程书籍,GitHub站点没有任何发送任何Notifications。尝试拉取更新: ![image](https://user-images.githubusercontent.com/17866683/48297808-f691d500-e4eb-11e8-9988-e8f95e1a7705.png) 想着总不能没有任何通知就把用户的GitHub仓库删了吧。估计是发邮件通知了,于是登录邮箱,果然发现了通知邮件。 `Gmail`如下: 图1: ![image](https://user-images.githubusercontent.com/17866683/48296920-6c8c4100-e4d8-11e8-90e7-3cdc527de98f.png) 图2: ![image](https://user-images.githubusercontent.com/17866683/48296922-8e85c380-e4d8-11e8-9254-66c90fb1751b.png) 图3: ![image](https://user-images.githubusercontent.com/17866683/48296939-c42aac80-e4d8-11e8-98c4-76cd5deb4d9d.png) 邮件中有一句话比较重要: > PLEASE NOTE: It is important that you reply within 24 hours to confirm whether you have made the...

软件工具

### 开始创建 Node.js 项目模版 通常我们创建一个新的 Node.js 项目,第一件要做的事情是使用`npm`进行一些初始化操作。 ```bash npm init ``` `npm`会交互式的问一些问题,创建`package.json`文件。 然后,从 [.gitignore 模版集合](https://github.com/github/gitignore)拷贝一份`.gitignore`的模版,可能还要为项目创建`LICENSE`文件。 **不够自动化,很没有效率** 直到看到这个 twitter ![image](https://user-images.githubusercontent.com/17866683/51328872-42926480-1aaf-11e9-8041-3eceaf8c4d22.png) https://twitter.com/bitandbang/status/1082331715471925250 这四行命令做了刚才手动的所有操作。 - `npx license mit > LICENSE`使用[license package](https://www.npmjs.com/package/license),下载并生成相应的 license 文件,这里是[MIT...

编程
Node.js

# 实现GAE和GKE k8s cron job的秒级调度单位 ### 问题 如何实现Google App Engine和Google Kubernetes Engine定时作业(`cron job`)的秒级调度(`schedule`)单位? 不同于`node-schedule`拥有秒级调度单位,可以将定时作业精确在某一秒执行。`GAE`和`GKE`的定时作业只能精确到分钟(`min`)。 在`GAE`的[定时作业]()文档中,`schedule`格式可以知道,时间单位的有效值包括: - `minutes` 或 `mins` - `hours` 在`GKE`的[定时作业]()文档中,CronJob 使用所需的 `schedule` 字段,该字段接受 Unix 标准 [`crontab`](https://en.wikipedia.org/wiki/Cron#Overview) 格式的时间。所有 CronJob...

技术文档
编程
GCP
Node.js

实验环境:阿里云ECS服务器,直接使用阿里云开放实验室,地址: https://edu.aliyun.com/lab/ 使用下面的实验创建一个实验用的远程ECS服务器 ![image](https://user-images.githubusercontent.com/17866683/53738444-2ebd8900-3eca-11e9-8de2-3508b8431086.png) 创建出来的远程ECS服务器信息如下图: ![image](https://user-images.githubusercontent.com/17866683/53738668-ccb15380-3eca-11e9-81b7-784ccad1608c.png) ### 首先,不使用代理服务器,直接使用`SSH`连接远程服务器 先查看下当前本机的外部(外网)IP地址: ```bash ☁ ~ curl ip.gs Current IP / 当前 IP: 223.167.246.30 ISP / 运营商: ChinaUnicom City / 城市: Shanghai Shanghai Country...

shadowsocks

**问题:** 使用`webpack` + es2015的`import()`语法进行`code splitting`时,需要指定`chunk name`,便于查看`chunk`具体是什么文件分离出的。 `webpack`版本: `3.10.0` `webpack`相关配置: ```js output: { publicPath: '/', filename: 'scripts/[name].[chunkhash].js', chunkFilename: 'scripts/[id].[name].[chunkhash].js', }, ``` 先看没有指定`chunk name`的写法和打包编译输出: 代码片段: ```jsx class App extends React.Component { render()...

JavaScript
webpack

### 上下文: 环境变量和配置文件在远程服务器上,在当前应用程序中要获取远程服务器上的配置文件,代码示范如下: `util.ts`: ```ts async function getConfigAsync() { console.log('getConfigAsync'); return { meta: await 'hello' }; } async function setToken() { //TODO: 获取config console.log('setToken: ', conf); } async function getToken()...

编程
ES6+