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
'use strict'; | |
const request = require('superagent'); | |
const express = require('express'); | |
const app = express(); | |
app.get('/', function(req, res) { | |
request | |
.get('https://www.example.com') | |
.then(response => res.send(response.text)) |
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
'use strict'; | |
const assert = require('chai').assert; | |
const nock = require('nock'); | |
const request = require('supertest'); | |
const uniqueValue = 'da64daaf-182b-4af6-a4af-09727bf8d5aa'; | |
const app = require('../../src/server'); | |
describe('server', function() { | |
it('GET / once', function() { |
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
'use strict'; | |
const assert = require('chai').assert; | |
const nock = require('nock'); | |
const request = require('supertest'); | |
const uniqueValue = 'da64daaf-182b-4af6-a4af-09727bf8d5aa'; | |
const app = require('../../src/server'); | |
describe('server', function() { | |
it('GET / once', function() { |
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
'use strict'; | |
const request = require('superagent'); | |
const express = require('express'); | |
const app = express(); | |
app.get('/', function(req, res) { | |
request | |
.get('https://www.example.com') | |
.then(response => res.send(response.text)); |
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
// Example for mocha; translate as needed for your favourite test framework | |
afterEach(function() { | |
... | |
if(!nock.isDone()) { | |
this.test.error(new Error('Not all nock interceptors were used!')); | |
nock.cleanAll(); | |
} | |
... | |
}); |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "DenyObjectDeleteWithWhitelist", | |
"Effect": "Deny", | |
"NotPrincipal": { | |
"AWS": [ | |
"arn:aws:iam::123456789012:role/my-lambda-role" | |
] |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "DenyObjectDeleteWithWhitelist", | |
"Effect": "Deny", | |
"NotPrincipal": { | |
"AWS": [ | |
"arn:aws:iam::123456789012:role/my-lambda-role", | |
"arn:aws:sts::123456789012:assumed-role/my-lambda-role/my-lambda-function" |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "DenyObjectDeleteWithWhitelist", | |
"Effect": "Deny", | |
"NotPrincipal": { | |
"AWS": [ | |
"arn:aws:iam::123456789012:role/SuperRoleOne", | |
"arn:aws:iam::123456789012:role/SuperRoleTwo" |
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
# Taken from http://blog.lesc.se/2011/11/how-to-change-file-premissions-in-git.html on January 12, 2018 | |
>git ls-tree HEAD | |
100644 blob 55c0287d4ef21f15b97eb1f107451b88b479bffe script.sh | |
>git update-index --chmod=+x script.sh | |
>git status | |
# On branch master | |
# Changes to be committed: | |
# (use "git reset HEAD <file>..." to unstage) | |
# |
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
MIT License | |
Copyright (c) 2017 Mark Tse | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |