Skip to content

Instantly share code, notes, and snippets.

var session
if (window.ApplePaySession) {
var merchantIdentifier = 'merchant.com.canine-clothing'
ApplePaySession.canMakePaymentsWithActiveCard(merchantIdentifier)
.then(function (canMakePayments) {
if (canMakePayments) {
showApplePayButtons()
}
});
}
@PaulGuo
PaulGuo / mongodb_setting_up_a_replica_set.md
Last active May 30, 2019 10:50 — forked from leommoore/mongodb_setting_up_a_replica_set.md
MongoDB - Setting up a Replica Set

MongoDB - Setting up a Replica Set

cd \mongodbdir\

mkdir db1
mkdir db2
mkdir db3

Primary

@PaulGuo
PaulGuo / index.js
Last active August 29, 2015 14:19 — forked from fxg42/index.js
import Promise from 'bluebird'
import MongoDB from 'mongodb'
Promise.promisifyAll(MongoDB)
async function findEveryone(db) {
const people = db.collection('people')
const everyone = await people.find().toArrayAsync()
return everyone.map( x => x.name )
}
@PaulGuo
PaulGuo / windvane.md
Last active August 29, 2015 14:11 — forked from sandywu/windvane.md

WindVane Bridge API (v1.2.2)

提供与客户端通讯的机制。支持WindVane SDK v2.2 以上版本。

WindVane 独有UA

windvane 在客户端中,会将原始UA后面跟上 WindVane/WindVaneSDK的版本号,你可以通过判断UA的方式来检查环境 其中,淘宝主客户端1212版本(IOS 3.4.5 ANDROID 3.9.5)后格式为

@PaulGuo
PaulGuo / douban.php
Created January 14, 2013 04:31 — forked from hugozhu/douban.php
#!/usr/bin/env php
<?php
function fetch_page($url, $timeout = 5) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);