This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "adon-test", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From: adon <[email protected]> | |
Date: Thu, 16 Jun 2016 14:13:18 +0800 | |
Subject: [PATCH] patch | |
--- | |
./protobuf.js | 9 +++------ | |
1 file changed, 3 insertions(+), 6 deletions(-) | |
diff --git a/protobuf.js b/protobuf.js | |
index b161ad1..7844c4b 100644 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* The following works for all RAWTEXT tags except a minor usability issue on the obsolete <xmp> tag. Take <style> as example. | |
* Canonicalization Goal: the </style> immediately after styleContent cannot be put inside an unclosed HTML comment, | |
* otherwise, older browsers (e.g., IE7) won't be able to close the style tag as in HTML5 parsing | |
* There's no problem regardless of whether the original style block is already enclosed in comment <!-- --> | |
* If it does, either styleContent<!----> or <!--styleContent--><!----> is okay, the injected block just opens and closes itself | |
* If it opens without closing, i.e., <!--styleContent<!----> is okay too, we successfully ended the comment with the last --> | |
* <%%> is similar and is for IE in particular | |
*/ | |
function rawTextCanonicalization(content) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var paypal = require('paypal-rest-sdk'); | |
paypal.configure({ | |
'mode': 'sandbox', //sandbox or live | |
'client_id': 'AUHU3rEmdnduhJ2imK4XsVV3NaNpRqqAZrUzl3vgXeBMnriivdIIUJqVCwPI50ItM-V_dvBVmj0_quLG', | |
'client_secret': 'ED6TKYUbhOADfnBHW0HOQpvsJju0tY4zW0lJ3x1trJtt3SAaG-G-MGh93sraOtutJL-PX5bseqZ_NPrY' | |
}); | |
app.get('/checkout/thankyou', function(req, res) { | |
// you need to apply some input checks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
app.get('/', function (req, res) { | |
res.send('hello world! ' | |
+ '<br/><a href="error">An example throwing error</a>' | |
+ '<br/><a href="error-handled">An example throwing error, but handled').end(); | |
}); | |
app.get('/error', function (req, res) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AWS = require('aws-sdk'), | |
fs = require('fs'); | |
// http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html#Credentials_from_Disk | |
AWS.config.loadFromPath('./aws-config.json'); | |
// assume you already have the S3 Bucket created, and it is called ierg4210-shopxx-photos | |
var photoBucket = new AWS.S3({params: {Bucket: 'ierg4210-shopxx-photos'}}); | |
function uploadToS3(file, destFileName, callback) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = require('./shopXX-ierg4210.config.js'), | |
express = require('express'), | |
exphbs = require('express-handlebars'), | |
anyDB = require('any-db'), | |
frontEndRouter = require('./frontend.js'); | |
var dbPool = anyDB.createPool(config.dbURI, { | |
min: 2, max: 20 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AWS = require('aws-sdk'), | |
fs = require('fs'); | |
// http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html#Credentials_from_Disk | |
// AWS.config.loadFromPath('./aws-config.json'); | |
// assume you already have the S3 Bucket created, and it is called ierg4210-shopxx-photos | |
var photoBucket = new AWS.S3({params: {Bucket: 'ierg4210-shopxx-photos'}}); | |
// filepath equals the location of the uploaded file you got from multer |