Skip to content

Instantly share code, notes, and snippets.

View nicknystrom's full-sized avatar

Nick Nystrom nicknystrom

  • Minneapolis, MN
View GitHub Profile
@nicknystrom
nicknystrom / gist:f4537489335f397cc979a15d18ad1d34
Last active May 31, 2018 19:41 — forked from madis/gist:4650014
Testing CORS OPTIONS request with curl
curl \
--verbose \
--request OPTIONS \
http://localhost:7000/api/graphql \
--header 'Origin: http://localhost:9292' \
--header 'Access-Control-Request-Headers: Origin, Accept, Content-Type' \
--header 'Access-Control-Request-Method: GET'
# http://nils-blum-oeste.net/cors-api-with-oauth2-authentication-using-rails-and-angularjs/#.UQJeLkp4ZyE
@nicknystrom
nicknystrom / chained-thens.js
Created October 13, 2016 21:57
Chained Promises
// create an admin user and company at the same time
handleCreate(msg) {
let company = null
return this.repository.insert({
active: true,
kind: msg.kind,
name: msg.name
})
.then(data => {
company = data