Skip to content

Instantly share code, notes, and snippets.

View amazingandyyy's full-sized avatar
🦄

Andy Chen amazingandyyy

🦄
View GitHub Profile
@amazingandyyy
amazingandyyy / twilio.sample.js
Last active October 4, 2016 04:38
Twilio SMS API (NodeJS snippet)
// To send sms message with Twilio SMS API in Node.js.
/*----------------------Sample codes----------------------*/
// .env
// TWILIO_ACCOUNT_SID='ACde4b5sample3cc1fb166ef26bd83e8'
// TWILIO_AUTH_TOKEN='4f631903940sample06869e988'
// TWILIO_NUMBER='+162822XXXXXX'
// init twilio
@amazingandyyy
amazingandyyy / SES.sample.js
Last active May 25, 2021 13:04
AWS SES(simple email service) API (NodeJS snippet)
// To send email with AWS Simple Email Service(SES) API in Node.js.
/*----------------------Sample codes----------------------*/
// .env
// AWS_KEY='AKAMTCsample2FUUQ'
// AWS_SECRET='4RsVEfTBJudFA9/pyFnjPvFsampleCbfq69bRV'
// AWS_IAM_NAME='IAM_NAME'
// AWS_SES_SENDER='email@aws.com'
@amazingandyyy
amazingandyyy / stripe.sample.js
Last active October 4, 2016 23:33
Stripe payment API (NodeJS snippet)
// use strip API to charge the card
var stripe = require('stripe')(process.env.STRIPE_API_SECRET)
// ... in models.js
stripe.charges.create({
amount: 50 * 100, // 50.00 dollars
currency: "usd",
source: dataObj.stripeToken.id,
description: `payment verification for ${dataObj.userData._id}!`
@amazingandyyy
amazingandyyy / gulp.es6.sample.js
Last active October 5, 2016 02:02
gulp for es6 -> all-browser-friendly
// change es6 to all-browser-friendly js
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var plumber = require('gulp-plumber');
var babel = require('gulp-babel');
gulp.task('js', ['clean:js'], function() {
return gulp.src('dev/**/*.js') // input files
.pipe(sourcemaps.init()) // help to show where error is init
@amazingandyyy
amazingandyyy / aws.s3.sample.js
Created October 4, 2016 23:34
upload photo to AWS S3 server and generate an URL
// need to be updated
@amazingandyyy
amazingandyyy / microsoft.computer_vision.sample.js
Created October 4, 2016 23:35
send photo URL to MS Computer Vision API to analyze photo
// need to be updated
@amazingandyyy
amazingandyyy / Advance: ServerKnowledge.md
Last active December 7, 2016 01:24
Advance Topic About Server Credential

Header

Discussion

var body = "hello world";
response.setHeader("Content-Length", body.length);
response.setHeader("Content-Type", "text/plain");
response.setHeader("Set-Cookie", "type=ninja");
response.status(200);

##Tech. skills:

  • 1. webpack
  • 2. es6 native Promise
  • 3. Redux middleware
  • 4. HOC in React
  • 5. scribbletune
  • 6. EclairJS - js-spark

##Project:

@amazingandyyy
amazingandyyy / yeah-restful.md
Last active January 2, 2017 22:27
Yeah Education Group RESTful API
@amazingandyyy
amazingandyyy / eb-deploy.md
Last active January 21, 2017 08:40
deploy express app to AWS by eb

#1. install eb, tutorial

$ brew install awsebcli
$ eb --version

#2. start to deploy

$ eb init
$ eb create