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
import { datadog } from 'datadog-lambda-js'; | |
import { Registry } from '../../Registry'; | |
import { TYPES } from '../../Types'; | |
import { | |
AccessLoggerMiddlewareFactory, | |
LambdaUtils, | |
} from '@ssense/serverless-middlewares'; | |
import { AccessLogger } from '@ssense/logger'; | |
import { Handler } from 'aws-lambda'; | |
import { LambdaHandler } from 'lambdas/LambdaHandler'; |
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
// Inspired by https://www.freecodecamp.org/news/supercharged-sorts-in-javascript/ | |
const sortBy = (prop) => (a, b) => (a[prop] ? -1 : b[prop] ? 1 : 0); | |
const sortByPair = (prop1, prop2) => (a, b) => (a[prop1] && a[prop2] ? -1 : b[prop1] && b[prop2] ? 1 : 0); | |
export default function superChangedSort(addresses) { | |
const byDefaultPair = sortByPair('someField', 'someOtherField'); | |
const byDefault = sortBy('default'); | |
const byName = sortBy('name'); |
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
datadog: | |
image: public.ecr.aws/datadog/agent:7 | |
labels: | |
com.datadoghq.ad.logs: '[{"service": "docker_service_name"}]' | |
volumes: | |
- /proc/:/host/proc/:ro | |
- /sys/fs/cgroup/:/host/sys/fs/cgroup:ro | |
- /var/run/docker.sock:/var/run/docker.sock:ro | |
- /var/lib/docker/containers:/var/lib/docker/containers:ro | |
environment: |
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
const AWS = require('aws-sdk') | |
const s3 = new AWS.S3(); | |
exports.handler = async (event) => { | |
let folderName, fileName; | |
try { | |
folderName = event['queryStringParameters']['folder']; | |
fileName = event['queryStringParameters']['name']; | |
} catch(e) { | |
return new Promise((reject) => { |
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
# Important that you set the path to the folder where your docker-compose.yml lives | |
# | |
# e.g. Documents/Git/workspace | |
DOCKER_COMPOSE_PATH='' | |
# ---------------DOCKER/DOCKER COMPOSE:------------------- | |
# Runs a docker command of your choice from anywhere. | |
# | |
# Usage: dc <command> |