In your command-line run the following commands:
brew doctor
brew update
// Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/ | |
// Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch | |
// async function | |
async function fetchAsync () { | |
// await response of fetch call | |
let response = await fetch('https://api.github.com'); | |
// only proceed once promise is resolved | |
let data = await response.json(); | |
// only proceed once second promise is resolved |
node('docker') { | |
stage 'start database' | |
docker.image('redis:3.0.7-alpine').withRun { c -> | |
def ip = hostIp(c) | |
stage 'client set' | |
docker.image('redis:3.0.7-alpine').inside { | |
sh "redis-cli -h ${ip} set test 123" |
{ | |
"compilerOptions": { | |
"jsx": "react", | |
// This must be specified if "paths" is set | |
"baseUrl": ".", | |
// Relative to "baseUrl" | |
"paths": { | |
// exemple: "*": ["*", "web_modules/*", "web_modules/shared/*", "test/*"] | |
} | |
} |
// Promise.prototype.finally | |
fetch('http://foo.bar') | |
.then(response => console.log(response)) | |
.catch(error => console.log(error)) | |
.finally(_ => console.log('finally')) | |
// try/catch/finally with Async/Await |
In your command-line run the following commands:
brew doctor
brew update
// for this to work you need to set `"chromeWebSecurity": false` in cypress.json | |
describe('Make Stripe Payment', function() { | |
before(function() { | |
cy.visit('http://localhost:3000/en/stripe/checkout/') | |
Cypress.Cookies.preserveOnce('sessionid') | |
}) | |
it('should enter credit card details and finalise payment', function() { | |
cy.get('[data-test="button-FormStripeCart-PayWithCreditCard"]').click() |
import * as admin from 'firebase-admin' | |
import * as fft from 'firebase-functions-test' | |
const ft = fft() | |
import * as sinon from 'sinon' | |
import { makeUppercase, addMessage } from './function' | |
describe('order', () => { | |
describe('makeUpperCase', () => { | |
it('should upper case input and write it to /uppercase', async () => { | |
const fakeSnaphost = ft.firestore.makeDocumentSnapshot({ |
#!/usr/bin/env bash | |
# | |
# Bootstrap script for setting up a new OSX machine | |
# | |
# This should be idempotent so it can be run multiple times. | |
# | |
# Some apps don't have a cask and so still need to be installed by hand. These | |
# include: | |
# | |
# - Twitter (app store) |
Sometimes, when rebasing interactively with git, we need to squash a sequence of commits in a branch.
For example, we need to transform this:
pick 0253dc894f bumped
pick 5a1e86933c remove dependency
pick bffoffb395 memberships rpc resource
pick 222fabf5e0 rpc membership service
pick 726a2f9a10 remove crypto logic