React Component Lifecycle
- getInitialState
- getDefaultProps
- componentWillMount
- componentDidMount
- shouldComponentUpdate (Update only)
- componentWillUpdate (Update only)
- componentWillReceiveProps (Update only)
- render
| router.get('/payments', verifyJWT_MW, function(req, res) { | |
| try { | |
| let transactions = []; | |
| const stream = Braintree.gateway.transaction.search(function(search) { | |
| search.customerId().is(req.user.account.braintreeCustomerId); | |
| }); | |
| stream.on('ready', function() { | |
| console.log(stream.searchResponse.length()); |
| const express = require("express"); | |
| const router = express.Router(); | |
| const User = require("../models/user"); | |
| const AWS = require("aws-sdk"); | |
| AWS.config.update({ | |
| accessKeyId: process.env.accessKeyId, | |
| secretAccessKey: process.env.secretAccessKey, | |
| region: "us-east-1" | |
| }); |
| 'use strict'; | |
| const crypto = require('crypto'); | |
| const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bytes (32 characters) | |
| const IV_LENGTH = 16; // For AES, this is always 16 | |
| function encrypt(text) { | |
| let iv = crypto.randomBytes(IV_LENGTH); | |
| let cipher = crypto.createCipheriv('aes-256-cbc', new Buffer(ENCRYPTION_KEY), iv); |
| import React from "react"; | |
| import PropTypes from "prop-types"; | |
| class Image extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { src: props.src }; | |
| } | |
| componentWillReceiveProps(nextProps) { |
| machine: | |
| node: | |
| version: 8 | |
| deployment: | |
| staging: | |
| branch: master | |
| owner: my-company | |
| commands: | |
| - ./deploy-staging.sh | |
| production: |
| const aws = require('aws-sdk') | |
| aws.config.update({ | |
| accessKeyId: process.env.aws_access_key_id, | |
| secretAccessKey: process.env.aws_secret_access_key, | |
| region: process.env.aws_region}); | |
| const options = { | |
| Bucket: process.env.s3_bucket, | |
| region: process.env.aws_region, |
| /* global window */ | |
| import React from 'react' | |
| import PropTypes from 'prop-types' | |
| const InputField = ({ | |
| label = 'Password', | |
| invalidLabel = 'The password field is required.', | |
| placeholder = 'Enter your password', | |
| input, | |
| onSubmit, |
React Component Lifecycle
| version: 2 | |
| jobs: | |
| build: | |
| docker: | |
| - image: 'circleci/node:9.7.1' | |
| branches: | |
| only: | |
| - master | |
| steps: | |
| - checkout |